Upon attempting to commit a repository, I get the error:
$ git commit
*** Please tell me who you are.
Run
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: unable to auto-detect email address (got '[output redacted]')
The obvious solution would be to run the git config
options in the output, however I do not want to do that.
The computer in question doesn't belong to a specific person but is a shared computer. Therefore, each commit would be a different user.
How do I bypass this and set author to be per commit and not a global?
Another option is to use the -c
flag to pass config paramter to the current command.
In your case git -c user.email="[email protected]" -c user.name="Your Name" commit ...
The -c
values override any other default values (set and unset parameters). Note that all the -c
options need to come before the command name commit
.
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