Open In App

How to Add GIT Credentials on Windows?

Last Updated : 27 May, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

Managing Git credentials on Windows is important for seamless interaction with remote repositories. Whether you’re pushing code to GitHub, GitLab, or another Git service, storing your credentials securely can save you from repeatedly entering your username and password. This article will walk you through various methods to add and manage Git credentials on Windows effectively.

Steps to Setup GIT Credentials

Step 1: To add your credentials for a remote server (Github, Gitlab, etc…), enter the following in the terminal:

git config –global credential.helper manager-core

  • credential-helper are git programs that help you save the credentials on your device.
  • manager-core is a credential manager for GIT, It supports authentication to GitHub, Bitbucket, and Azure Repos.
Adding-credentials

 

To set your username, enter the following (Change <username> with the preferred username):

git config –global user.name <username>

Further, if you want to set your email, just change user.name to user.email (Change <email> with the preferred email),

git config –global user.email <email>

Setting-username

 

Setting-email

Note: If you want to set this config for a single repo, remove the ‘–global’ option as it changes the config for all the current repos and any other repos you make.

Step 2: The next time you will commit/push to the repo for which you added the credentials, GIT will ask you for the credentials for that particular remote server if it is unable to find the username and password already stored.



Next Article
Article Tags :

Similar Reads