We all know you can set Git email and username in git.config.
What's the best approach when two users use the same machine?
We all know you can set Git email and username in git.config.
What's the best approach when two users use the same machine?
If having separate user accounts was not an option, I'd write a small script to set these GIT_AUTHOR_*** environment variables: https://git-scm.com/book/en/v2/Git-Internals-Environment-Variables#Committing
The sequence of actions:
git init --sharedchown -R :<the_group> . inside the repo.git clone /path/to/the/repo from within their home folders) and work each in their private repo clones with their own personal settings, including name and e-mail. They need to publish their work periodically with git push.If you interested in adding user information on commits, you can set author on each commit.
git commit -m "some message" --author "[email protected]"