14

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?

asked Feb 29, 2012 at 0:05
5
  • is the username already specified in origin? Commented Feb 29, 2012 at 0:16
  • In Settings - Global settings tab? User name = [email protected] and user email = [email protected]. Or is there somewhere else I need to set it at? Commented Feb 29, 2012 at 0:28
  • check in .git/config, what is the value of url under [remote "origin"]? Commented Feb 29, 2012 at 2:04
  • url = [email protected]/p/project Commented Feb 29, 2012 at 3:31
  • That was supposed to read: url - "https: //[email protected]/p/project" (Space added to prevent automatic hyperlink Commented Feb 29, 2012 at 3:42

2 Answers 2

23

Remove username@ from the url entry for origin in .git/config

answered Feb 29, 2012 at 4:07
Sign up to request clarification or add additional context in comments.

Might also be helpful to some to point out that this is done in the repository folder, not the global config. (was the case for me anyway)
7

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.

answered May 14, 2012 at 22:29

Worked like a charm and I think

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.