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 [email protected]
Cloned
$ git clone https://[email protected]/p/repository/
Then I made changes to files / added new files etc. and added
$ git add .
Committed
$ git commit -m "Message"
Pulled to make sure I am up to date
$ 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
Any suggestions? Thanks.
The most likely reason for this is that Git has been configured to use a credential helper. The configuration could have been made a) for all users in your system b) only for your user c) for a specific repository.
You can avoid being prompted for your password by configuring Git to cache your credentials for you. Once you've configured credential caching, Git automatically uses your cached personal access token when you pull or push a repository using HTTPS.
For similar issues NOT specific to machine.google.com, you can try removing or updating the saved git password in windows credential manager. My system had my old password saved:
credit: https://github.com/Microsoft/Git-Credential-Manager-for-Windows/issues/141
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 [email protected] 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 [email protected] password mypasswordXXX123" > $HOME/_netrc
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With