EV: How to use .netrc file on windows to save user and password

Copy from Stack Overflow:

http://stackoverflow.com/questions/6031214/git-how-to-use-netrc-file-on-windows-to-save-user-and-password
 
Question
--------------------------------------------------------
Is it possible to use a .netrc file on windows when I'm using Git to clone a remote repository with http and user - password?
 
Answer
--------------------------------------------------------

You must define:

  • environment variable %HOME%
  • put a _netrc file in %HOME%

If you are using Windows 7

run the cmd type this:

setx HOME %USERPROFILE%

and the %HOME% will be set to 'C:\Users\"username"'

then go to it and make a file called '_netrc'

Note: for Windows, you need a '_netrc' file, not a '.netrc'.

Its content is quite standard (Replace the with your values):

machine
login
password
machine
login
password

posted on 2013-12-26 22:56  weihongji  阅读(267)  评论(0编辑  收藏  举报

导航