Saving username and password with TortoiseGit

Saving your login details in TortoiseGit is pretty easy.  Saves having to type in your username and password every time you do a pull or push.

1. Create a file called _netrc with the following contents:

login <login>
password <password>

2. Copy the file to C:\Users\<your-username> (or another location; this just happens to be where I’ve put it)

3. Go to command prompt, type setx home C:\Users\<your-username>

Note: if you’re using something earlier than Windows 7, the setx command may not work for you.  Use set instead and add the home environment variable to Windows using via the Advanced Settings under My Computer.

16 thoughts on “Saving username and password with TortoiseGit

  1. Pingback: Saving Credential in TortoiseGit |

  2. Hi,
    Great post, very useful.

    I struggled a little bit letting it work on codeplex and found out you need to mention the sub domain (of course, silly me) as well. So machine name would be in my case.

  3. Pingback: How to: TortoiseGit save user authentication / credentials | SevenNet

  4. Pingback: KSP Dev tips | Warren Schultz

  5. Thanks. This was really helpful. Hated having to type the login credentials every time i tried to pull or push the repo

Leave a Reply

Your email address will not be published. Required fields are marked *