Override configured user for a single git commit

First, the author is not necessarily the same as the committer. Git tracks both.

To set what name to use for just this repository, you could do:

git config user.name "Your Name"
git config user.email "Your email"

Notice the absence of the --global option. This will set the configuration in this repository only.

Alternatively, you can do this for only a single command, using the -c option:

git -c "user.name=Your Name" -c "user.email=Your email" commit ...

But I think it’s better to just use the config options above.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)