Git: netrc -d -v $@ get: netrc: command not found

528 Views Asked by At

I use _netrc on Windows (there are reasons I need to use it) which is setup correctly, but several months ago, when I push to TFS it still asks me for password and I see these 2 warning messages:

netrc -d -v $@ get: netrc: command not found
netrc -d -v $@ store: netrc: command not found

What do those messages signify, are they related to why my _netrc file is ignored, and do they mean that I need to to install a netrc command?

Edit: Another thing is that I need to disable Git Credential Manager (i.e. I uncheck that checkbox) - again, there are reasons to do that. In older versions of Git _netrc worked as an alternative of Git Credential Manager and was not dependent on its presence. Has that changed in newer versions?

enter image description here

1

There are 1 best solutions below

1
On

I would just close this as a duplicate of Git - How to use .netrc file on Windows to save user and password and Git .netrc file authentication issue, but you asked what these messages signify, rather than just how to fix the problem, and you may have already configured credential.helper as well. So: When Git needs a credential—a user name or password, for instance—Git never1 just tries to make one up, or supply it on its own. Instead, Git consults your configuration and/or then runs a credential helper.

A credential helper is any arbitrary program you like, but with a couple of catches:

  • Git runs the program with one argument: the literal word get, store, or erase. This process is described in the gitcredentials documentation.

  • You can configure Git to run any program you like, but whatever you set in your configuration—say, P—Git will run git-credential-P.

These programs can be ones already exist and are provided by your OS, or ones you obtain from anywhere you like and install anywhere you like. The "contributed software" part of a Git installation includes a program named git-credential-netrc, for instance.

Oddly, your output says netrc -d -v get etc., rather than git-credential-netrc -d -v get. If you configured a credential.helper setting of netrc -d -v, you should be seeing git-credential-netrc as the not-found command. So I assume you've configured some other program, which does exist, which is itself trying to run netrc. You may need to locate this program and figure out why it runs netrc, whether it should run netrc, etc. Typically a .netrc file is either a plain-text file or an encrypted file, and we don't run any command to read it—we just open it up and read its data. We might run a command to decrypt its data, and that's much of what the git-credential-netrc helper, written in Perl, is all about, but that decryption command is not spelled netrc either.


1Insert Gilbert and Sullivan H.M.S. Pinafore routine here.