Git bash for Windows NOT prompting for password

我怕爱的太早我们不能终老 提交于 2019-12-05 11:16:14
Adam Rofer

Edit: 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


That said, this might work:

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

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.

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

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

echo "machine code.google.com login blah.blah@gmail.com password mypasswordXXX123" > $HOME/_netrc

The comment by ufk is the correct answer. To be more explicit, if you push with

git push https://code.google.com/p/name-of-project/ master

you will be prompted for username and password (assuming .netrc is not set as specified by OP). Instead of master you could specify another branch, but omitting the branch probably won't work.

Put the following command in git bash

git config --global core.askpass /usr/libexec/git-core/git-gui--askpass

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!