Timeline for answer to Git - How to use .netrc file on Windows to save user and password by VonC
Current License: CC BY-SA 4.0
Post Revisions
40 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| S Dec 23, 2025 at 15:41 | history | suggested | n0099 | CC BY-SA 4.0 |
update commit author
|
| Dec 23, 2025 at 13:59 | review | Suggested edits | |||
| S Dec 23, 2025 at 15:41 | |||||
| Jun 12, 2022 at 14:32 | comment | added | VonC |
@AndreyS If you see HOME defined in your user environment variables, but you don't see it when typing set HOME in your current CMD, you need to open a new CMD in order for said shell session to inherit the variables you have defined.
|
|
| Jun 12, 2022 at 12:40 | comment | added | vel |
@VonC can you please help me? I am having WIndows Server 2019 and I am not able to set HOME environment variable. When I list vars with set I do not see that in the list only HOMEPATH, but if I open manually Edit environment variables I do see HOME env. What is the issue? I have defined _netrc file but it seems it does not work for that reason. echo %HOME% has as output %HOME% Thanks a lot!
|
|
| Aug 29, 2018 at 6:11 | comment | added | VonC | @PeterMortensen I have reorganized the answer as requested. Let me know how I can improve it further, if needed. | |
| Aug 29, 2018 at 6:10 | history | edited | VonC | CC BY-SA 4.0 |
reformat answer
|
| Aug 28, 2018 at 19:23 | comment | added | VonC | @PeterMortensen I see... a bit more complex than "active reading", then ;) I'll get on it shortly. | |
| Aug 28, 2018 at 19:20 | comment | added | Peter Mortensen | This is important content (I got here while researching something at work). Perhaps reverse the order so that the most important information comes first (information about newer versions of Git comes first)? And perhaps remove the historical information, "(Original answer)", "Update late 2012", etc. The dates should be the release dates for the Git versions, not when this post was updated. This answer could be divided into subsections, for each Git version range. | |
| Jun 3, 2018 at 22:51 | history | edited | VonC | CC BY-SA 4.0 |
add Git 2.18
|
| Jan 7, 2018 at 20:19 | history | edited | VonC | CC BY-SA 3.0 |
add Windows syntax
|
| May 23, 2017 at 12:02 | history | edited | URL Rewriter Bot |
replaced http://stackoverflow.com/ with https://stackoverflow.com/
|
|
| Apr 12, 2015 at 23:07 | comment | added | Iulian Onofrei |
Well, the _netrc didn't work for me on a Windows 7 PC, but the .netrc worked for youtube-dl with the --netrc argument passed to it.
|
|
| Jul 14, 2014 at 18:27 | comment | added | VonC | @JohnLittle strange: it works fine for me (with msysgit, not tested with TortoiseGit). Note, openssh has nothing to do with this credential helper, which is only for https url, not ssh. | |
| Jul 14, 2014 at 18:23 | comment | added | John Little | This method does not work for me. Git always prompts for passphrase. Using windows 8, openssh, tortoise git and windows git. For machine am just using github.com. I set the HOME dir to my home, where the _netrc file is, no luck. | |
| Aug 23, 2013 at 6:31 | comment | added | HyperGroups | @VonC Fine, today it's ok now, I'm not sure which method makes it works well, wish it'll good as always. If it doesn't work well, then I'll edit and add more details and ask you again, thanks. | |
| Aug 22, 2013 at 14:09 | comment | added | VonC | @HyperGroups you can try and restart your computer, but if it still fails, ask a question on Stack Overflow with as many details as you can, and the exact error message. | |
| Aug 22, 2013 at 13:25 | comment | added | HyperGroups | @Vonc I've tried that, seems failed,,,bad ,,,Should I restart computer? Let me check and do that again... | |
| Aug 22, 2013 at 13:21 | comment | added | VonC |
@HyperGroups yes: use an encrypted _netrc file in your %HOME%, as described in this answer. By the way, your question is a Stack Overflow question, not a programmers.SE one.
|
|
| Aug 22, 2013 at 13:10 | history | edited | VonC | CC BY-SA 3.0 |
add link
|
| Aug 22, 2013 at 13:01 | comment | added | HyperGroups | Do you know how to solve this question?programmers.stackexchange.com/questions/209140/… | |
| Jun 12, 2013 at 6:27 | comment | added | SurfRat | On my work machine the _netrc method would not work when placed into my profile C:\Users\Name.Domain. Moved to C:\Users\Name and it works. | |
| Apr 23, 2013 at 12:10 | history | edited | VonC | CC BY-SA 3.0 |
update credential helper
|
| Apr 23, 2013 at 8:32 | history | edited | VonC | CC BY-SA 3.0 |
add encrypted netrc
|
| Feb 20, 2013 at 7:31 | history | edited | VonC | CC BY-SA 3.0 |
add link to credential helper
|
| Jun 28, 2012 at 22:03 | comment | added | VonC | @HawkeyeParker yes, it should be the fqn (fully qualified name) of your Git server. | |
| Jun 28, 2012 at 21:57 | comment | added | Hawkeye Parker | In the _netrc file, the value for "machine" should be something like: "githubenterprise.mycompany.com" | |
| May 11, 2012 at 6:41 | comment | added | Sam Saffron | @VonC I am on 1.7.6 ... but Marc is on 1.7.8, so it must be a different issue | |
| May 11, 2012 at 6:35 | comment | added | VonC | @SamSaffron What version of Git are you using? Just to make sure it isn't related to stackoverflow.com/questions/10464250/remote-pushurl-wont-work and github.com/git/git/blob/master/Documentation/RelNotes/… | |
| May 11, 2012 at 5:29 | comment | added | Sam Saffron | @VonC I just added another trap both Marc and I hit to the bottom. | |
| May 11, 2012 at 5:28 | history | edited | Sam Saffron | CC BY-SA 3.0 |
added 570 characters in body
|
| S Mar 27, 2012 at 8:37 | history | suggested | Vincent Scheib | CC BY-SA 3.0 |
Clarifying netrc format
|
| Mar 27, 2012 at 4:13 | review | Suggested edits | |||
| S Mar 27, 2012 at 8:37 | |||||
| Feb 10, 2012 at 10:36 | history | edited | VonC | CC BY-SA 3.0 |
include comments
|
| Feb 3, 2012 at 4:58 | comment | added | VonC |
@爱国者 netrc is used by curl, and works for http protocol, as shown in this example (look for 'netrc' in the page): maymay.net/blog/2008/08/08/… . Also used with http protocol here: stackoverflow.com/questions/5193643/…
|
|
| Jan 23, 2012 at 21:39 | comment | added | VonC |
@Luke: yes, the git-cmd.bat included in msysgit does set the %HOME% environment variable, as I mentioned last December: stackoverflow.com/questions/8514097/…
|
|
| Nov 11, 2011 at 10:31 | history | edited | David Schmitt | CC BY-SA 3.0 |
fixed syntax error
|
| S Nov 9, 2011 at 11:54 | history | suggested | Abdulrhman Alkhodiry | CC BY-SA 3.0 |
adding the way to set %HOME% in windows 7
|
| Nov 9, 2011 at 11:36 | review | Suggested edits | |||
| S Nov 9, 2011 at 11:54 | |||||
| May 17, 2011 at 13:23 | vote | accept | Bernd Klaus | ||
| May 17, 2011 at 13:13 | history | answered | VonC | CC BY-SA 3.0 |