I work with my own projects and every-now-and-then I do some work for third-parties where I need to use their contact-information etc in commits. I usually use just global commit names etc but now I need to specify commit names and emails according to the directory. How can I do that in Git?
Perhaps useful relating information
What is the difference between author and committer in Git?
Git commit with no email
You can have a per-repository username and email address that supercedes your global settings. It will affect commits made in the current repository, but not in other repositories.
git config user.name "Foo Bar"
git config user.email "[email protected]"
You can confirm that your local information is overriding your global defaults with:
git config -l | fgrep user.
It may show multiple entries (e.g both a global and a local configuration setting), but whatever is shown last in the list takes precedence.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With