Brandon Nguyen
Brandon Nguyen

Reputation: 345

Bypass "Tell me who you are" error in git

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?

Upvotes: 14

Views: 28665

Answers (2)

Mureinik
Mureinik

Reputation: 311393

You could use the --author flag:

$ git commit --author="A U Thor <[email protected]>" 

Upvotes: 0

CodeWizard
CodeWizard

Reputation: 142114

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.

Upvotes: 25

Related Questions