user852830
user852830

Reputation:

File '_netrc' / '.netrc' is not accepted by Git

I have set the %HOME% environment variable on my Windows installation.

In that folder I have put a file called _netrc. Inside that file I have:

machine code.google.com login <logon> password <censored>

But both, MSYS and Tortoise keep asking for a password.

I am using Windows 7, MSYSGit and TortoiseGit. Why does this not work?

I have found an article on Stack Overflow that said it must be named _netrc and not .netrc, but none of them work.

Upvotes: 7

Views: 10110

Answers (2)

Brian Rogers
Brian Rogers

Reputation: 31

I've been bashing my brains against this one too and I have a solution different from those posted.

Ensure that your _netrc file is Ascii encoded. If using ECHO redirecting to a file on standard out, Windows uses the UCS-2 LE BOM file format. Some other apps might also have a different default from Ascii.

So, if creating this file via script, use Set-Content -Encoding Ascii rather than a STOUT redirect. If creating this file via notepad++ or vim, ensure the encoding is set to ASCII.

Upvotes: 3

eckes
eckes

Reputation: 67057

Assuming you did everything that was described in this answer and you set the right location for your %HOME% environment variable (confirm this with an echo %HOME% and check that in that location there's a _netrc file), there must something be wrong in the usage of your repository.

The URL to clone a Google Code repository is https://user.googlecode.com/svn/trunk (see this Google link for that).

So, you have to do a

git svn clone https://user.googlecode.com/svn/trunk

in order to import your Google repository.

Upvotes: 5

Related Questions