DEV Community

Discussion on: I'm a Git Master, Ask Me Anything

Collapse
 
elonmusk profile image
Mt

How can I assign a GitHub user to a specific .git repo, and not global? I need to have different users for different repos in the same laptop

Collapse
 
gonedark profile image
Jason McCreary • Edited

If I understand correctly, you use different GitHub users for different repos on the same machine.

The way Git configuration works is it will look for local config, then roll up to global config. So, you can set the author info for each local repo by running:

git config user.name "JMac"
git config user.email "jmac@example.com"

(note the missing --global)