Search code examples
macosgitgoogle-code

Setting up GIT on Mac OS to work with Google Code


When I try to push the repository from a MacOS Shell I get this error

fatal: remote error: Invalid username/password. You may need to use your generated googlecode.com password; see https://code.google.com/hosting/settings

How should I provide it with the right password?


Solution

  • It should pick up your credentials in your ~/.netrc file, which should include:

    machine code.google.com 
    login your_CodeGoogleCom_Login 
    password your_CodeGoogle_password
    

    (and chmod go= ~/.netrc)

    Make sure to do:

    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
    

    (avoid using an url like https://[email protected]/p/projectname when you are using a .netrc file for credentials)