-1

I need to know the best practice of using different git users for different local repositories on a same machine. For example:- I have one git user for the work project and another private git user for personal stuff. Each time I go for a different user I first need to remove the existing git user credentials from the generic credential manager on windows and then login into another git user, otherwise I end up using only one user for everything.

Avi Rai
  • 99
  • 2

1 Answers1

2

The Git FAQ outlines how to do this with both HTTPS and SSH. For HTTPS, you use the username in the URL, and for SSH, you use different aliases for your ~/.ssh/config file, which you then use in your URL instead of the hostname. The HTTPS approach is typically easier to implement.

bk2204
  • 64,793
  • 6
  • 84
  • 100