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 ­čÖé

Advertisements

Saving Commit Templates using Git Extensions

Introduction

Nowadays in projects, developers are using a common commit template for all commits in Git. This post provides the step by step details to save commit template in the Git Extension tool.

Commit template

The sample commit template will look as follows

[JiraId]: <Description>
[Link]:
[Versions]:
[ReviewedBy]: <PeerName>

Steps to save templates in Git Extensions

The following steps will demonstrate the steps to save the templates

  1. Commit the changes using Git Extensions toolsaving commit 1
  2. In the commit window, we are having the option called commit templates. By selecting settings option in commit templates dropdown we can add our templatessaving commit 2
  3. We can add various commit templates with appropriate provided optionssaving commit 3
  4. Once we added our templates, we can able to quickly select various templates as followssaving commit 4

saving commit 5

Cool ­čÖé That’s it.

Happy coding!