Related questions: netrc not accepted by git and Git - How to use .netrc file on windows to save user and password
I am trying to push changes to a code.google.com git repository. I am using Git Extensions. My HOME variable is set in both Windows and Git Bash.
C:\> echo %HOME%
C:\Users\Username
$ echo $HOME
/c/Users/Username
And I have added a file in %HOME% called _netrc
machine code.google.com
login [email protected]
password GOOGLEGENERATED
Obviously Username is replaced by my username and GOOGLEGENERATED is the google generated password. When attempting to push, I get this error message:
C:\Program Files\Git\bin\git.exe push -u --recurse-submodules=check "origin" master:master Done fatal: remote error: Invalid username/password. You may need to use your generated googlecode.com password; see https://code.google.com/hosting/settings
The related questions suggest that everything is setup properly, but it is still not working. Any ideas?
In the command line, navigate to the root directory of your project. Initialize the local directory as a Git repository. To create a repository for your project on GitHub, use the gh repo create subcommand. When prompted, select Push an existing local repository to GitHub and enter the desired name for your repository.
The git push command is used to upload local repository content to a remote repository. Pushing is how you transfer commits from your local repository to a remote repo.
Remove username@ from the url entry for origin in .git/config
So, for those who are new at this, do the following in git bash:
git config --global user.name "google.username"
git config --global user.email "[email protected]"
git remote set-url origin https://code.google.com/p/projectname
This worked for me. I didn't do anything with a _netrc or .netrc file.
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