Saving Git Username and Password in Tortoise Git

When we are dealing with Git commits multiple times daily, it will be difficult and time-consuming if we enter our username and password every time.

If we didn’t save our credentials, whenever we try to push our source code to the origin.

Bang!

tortoise-git

Credentials window occurs and consumes our valuable time.

By using following steps we can save our Git credentials in Tortoise Git

Create a text file called _netrc in the home directory

%userprofile%

(e.g. c:\users\pandiyan\_netrc).

Or we can create the file in any path, but the path which contains the file should be added in the HOME environment variable. The file path URL should not contain any space character.

And the file should contain the credentials with the following format:

machine

login

password

example:

machine github.com

login myloginid

password mypassword

we can add multiple instance details too. By doing the above steps, login window won’t appear every time. We save our valuable time and spend that in some other ways.

Happy Coding 🙂

Buy Me a Coffee at ko-fi.com

7 thoughts on “Saving Git Username and Password in Tortoise Git

  1. Anjali August 3, 2018 / 1:07 pm

    Awesome!!! It worked for me.

    Liked by 1 person

  2. Gabriel Hernandez April 22, 2019 / 9:26 pm

    Awesome, also works for me, the machine is the domain you’re trying access to, in my case: bitbucket.org

    Liked by 1 person

    • Admin July 2, 2019 / 5:34 pm

      The file should be named _netrc and located in c:\Users\.

      You will need to set an environment variable called HOME=%USERPROFILE% (set system-wide environment variables using the System option in the control panel. Depending on the version of Windows, you may need to select “Advanced Options”.).

      The password stored in the _netrc file cannot contain spaces (quoting the password will not work).

      Like

  3. Admin July 2, 2019 / 5:33 pm

    The file should be named _netrc and located in c:\Users\.

    You will need to set an environment variable called HOME=%USERPROFILE% (set system-wide environment variables using the System option in the control panel. Depending on the version of Windows, you may need to select “Advanced Options”.).

    The password stored in the _netrc file cannot contain spaces (quoting the password will not work).

    Like

Leave a comment