Saturday, February 1, 2014

No Prompt Google Code Credentials for Git

I'm trying to push my latest and greatest git repo to google code and I fat fingered the user/password. Now forever I get

git push --all googlecode

fatal: remote error: Invalid username/password.

Now it won't prompt me again for the credentials and I can't figure out how to get it to forget what I entered already. I tried to remote and add the remote repo but still it remembers. 

The solution is to create a .netrc file and place in your home directory. The googlecode link https://code.google.com/hosting/settings provides the content for .netrc

Should look something like

machine code.google.com login your-google-email@gmail.com password kasdlkjflskj





Converting Googlecode repo from Subversion to Git

I figured this would be simple. Following the instructions I wind up with an error on the git svn command

ceylon:dev andrew$ git svn clone --stdlayout http://myproject.googlecode.com/svn/  myproject
Can't locate SVN/Core.pm in @INC (@INC contains: /usr/local/git/lib/perl5/site_perl/5.16.2/darwin-thread-multi-2level /usr/local/git/lib/perl5/site_perl/5.16.2 /usr/local/git/lib/perl5/site_perl /Library/Perl/5.16/darwin-thread-multi-2level /Library/Perl/5.16 /Network/Library/Perl/5.16/darwin-thread-multi-2level /Network/Library/Perl/5.16 /Library/Perl/Updates/5.16.2 /System/Library/Perl/5.16/darwin-thread-multi-2level /System/Library/Perl/5.16 /System/Library/Perl/Extras/5.16/darwin-thread-multi-2level /System/Library/Perl/Extras/5.16 .) at /usr/local/git/lib/perl5/site_perl/Git/SVN/Utils.pm line 6.
BEGIN failed--compilation aborted at /usr/local/git/lib/perl5/site_perl/Git/SVN/Utils.pm line 6.
Compilation failed in require at /usr/local/git/lib/perl5/site_perl/Git/SVN.pm line 26.
BEGIN failed--compilation aborted at /usr/local/git/lib/perl5/site_perl/Git/SVN.pm line 33.
Compilation failed in require at /usr/local/git/libexec/git-core/git-svn line 25.

BEGIN failed--compilation aborted at /usr/local/git/libexec/git-core/git-svn line 25.

After some poking around I realized I had to disable the version of Git that comes with Xcode due to some incompatible something or other. So I did

sudo mv /usr/bin/git /usr/bin/git-xcode

And installed git from http://git-scm.com/download/mac

So, apparently this git install isn't 100% awesome. To convert my repository I need to use Xcode git, so

/usr/bin/git-xcode svn clone --stdlayout http://myproject.googlecode.com/svn/  myproject

This works, yay!