Multiple Git Users On Same Machine

If you don't have enough disk space for separate clones, you can try the following:

Use differente logins and write a script that changes the username and email on login.

OR (if you really want to use one account only)

Write a script that asks after every login for the username and email. That way nobody can forget to change the username and email.


Make a repository clone for each developer on mac, and set user.name and user.email config variable for each clone (project level property). So, in this case each developer have to use own project (just different directories).

To set project level property execute (current directory should be the root of the project):

git config user.name "User Name"
git config user.email "UserEmail@Host"

UPDATE Also if the only reason you are using the same login for different developers is disk space, you can create one clone in /Users/Shared/, configure user.name and user.email variables in $HOME/.gitconfig and voila!

Tags:

Git

Multi User