roostertech

coding and day dreaming

Using git and .netrc

Today I was initializing another google code project git repo. I use .netrc to store the googlecode password.

Clone – Push – Error

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

I went back and check on my other googlecode git repo, everything is still working fine, so it can’t be a problem with the password/.netrc. Eventually I realize that git has initialized my .git/config with

[remote "origin"]
 fetch = +refs/heads/*:refs/remotes/origin/*
 url = https://username@code.google.com/p/projectname/

Instead of

[remote "origin"]
 fetch = +refs/heads/*:refs/remotes/origin/*
 url = https://code.google.com/p/projectname/

Removing the username from git config fix the issue.

Advertisements

One response to “Using git and .netrc

  1. Pingback: Getting Started with Git on Google Code | Monkeyologist

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: