Windows的Git bash不提示输入密码 [英] Git bash for Windows NOT prompting for password

查看:111
本文介绍了Windows的Git bash不提示输入密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是学生,并且是版本控制软件的新手,所以我很难弄清楚这一点.我正在使用Google代码Git存储库.要访问此存储库,我在Windows 7上使用Git Bash.问题在于,当我执行推送步骤时,没有提示我输入密码.例如:

I am student, and very new to version control software so I am having trouble figuring this out. I am using a Google code Git repository. To access this repository I am using Git Bash on Windows 7. The problem is that when I reach the push step, I am not being prompted for a password. For example:

首先,我像这样设置全局变量:

First I set global variables like this:

git config --global user.name "Your Name"
git config --global user.email youremail@gmail.com 

克隆

$ git clone https://UserName@code.google.com/p/repository/

然后我对文件进行了更改/添加了新文件等,并添加了

Then I made changes to files / added new files etc. and added

$ git add .

承诺

$ git commit -m "Message"

拉动以确保我是最新的

$ git pull
Already up-to-date.

但是当我按下按钮时,不会提示您输入密码

But when I push I am not prompted for password

$ git push origin master
fatal: remote error: Invalid username/password.
You may need to use your generated googlecode.com password; see https://code.goo
gle.com/hosting/settings

有什么建议吗?谢谢.

推荐答案

您似乎无法通过将用户名放入URL中来成功访问Google代码(至少从2011年8月开始),请参见: netrc不被git接受

Looks like you can't access google code successfully by putting the username in the URL (at least as of August 2011), see this: netrc not accepted by git

也就是说,这个可能工作:

从上面显示的URL中提取出来(您必须访问网站):

Taken from the URL shown above (you have to visit the site):

对于Git存储库,您可以在.netrc文件中添加以下行,记录您有权提交访问的每个存储库域的密码.确保已在.netrc上设置了权限,以便只有您的用户帐户才能读取它.

For Git repositories, you can add the following line to your .netrc file recording your password for each repository domain you have commit access to. Make sure you have set the permissions on .netrc so that only your user account can read it.

计算机code.google.com登录名blah.blah@gmail.com密码mypasswordXXX123

machine code.google.com login blah.blah@gmail.com password mypasswordXXX123

一旦有了上述项目,在Git Bash中您就应该能够像这样更新_netrc文件:

Once you have the above item, it looks like in Git Bash you should be able to update your _netrc file like this:

echo计算机代码.google.com登录名blah.blah@gmail.com密码mypasswordXXX123">$ HOME/_netrc

这篇关于Windows的Git bash不提示输入密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆