Skip to content
Tutorials Center
My learning

Topics

Git Reference ยท Environment Variables

GIT_AUTHOR_* and GIT_COMMITTER_*

Reference for GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL, GIT_AUTHOR_DATE and the COMMITTER counterparts: precedence, date formats, and reproducible commit hashes.

Every commit records two identities: the author, who wrote the change, and the committer, who put it into the repository. Each has a name, an e-mail address and a date. Usually they are the same person and the same moment, but they differ after git commit --amend, git rebase, git cherry-pick and when a maintainer applies someone else's patch with git am.

Six environment variables override what Git would otherwise read from configuration: GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL, GIT_AUTHOR_DATE, GIT_COMMITTER_NAME, GIT_COMMITTER_EMAIL and GIT_COMMITTER_DATE. Because the commit hash covers all six values, setting all of them to fixed values is also how you create commits with a reproducible hash, which is how the examples on this site keep their output stable.

Terminal
GIT_AUTHOR_NAME="Ada" GIT_AUTHOR_EMAIL="[email protected]" \
GIT_AUTHOR_DATE="2026-01-01T12:00:00Z" git commit -m "message"
git var GIT_AUTHOR_IDENT     # what Git would use as the author right now
git var GIT_COMMITTER_IDENT

Try it

Bash Author and committer are separate

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with read or cat), it gets the next line from this box.

Bash Date formats and who changes what

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with read or cat), it gets the next line from this box.

Syntax

Variable Description
GIT_AUTHOR_NAME The author's name.
GIT_AUTHOR_EMAIL The author's e-mail address.
GIT_AUTHOR_DATE When the change was written.
GIT_COMMITTER_NAME The committer's name.
GIT_COMMITTER_EMAIL The committer's e-mail address.
GIT_COMMITTER_DATE When the commit was created.
EMAIL Fallback e-mail address when neither the environment variables nor user.email give one.

Date formats Git accepts: ISO 8601 (2026-01-01T12:00:00Z, 2026-01-01 12:00:00 +0200), RFC 2822 (Tue, 06 Jan 2026 08:00:00 +0000), and Git's internal form <unix-seconds> <timezone>, such as 1767686400 +0000. Without a time zone the local zone is used. The --date=<date> option of git commit sets only the author date.

Usage notes

  • Precedence. For the name and e-mail: the environment variable, then author.name/author.email (or committer.*), then user.name/user.email, then, for the e-mail only, EMAIL. As a last resort Git may guess from the login and host name; with user.useConfigOnly set to true, or when no guess is possible, the commit fails with "Please tell me who you are".
  • Author and committer when replaying. git rebase, git cherry-pick and git commit --amend keep the author and set the committer to you at the current time. git am keeps the author from the patch. To keep the original committer date too, rebase with --committer-date-is-author-date; to give every replayed commit a new author date, use --reset-author-date.
  • Reproducible commits. The hash depends on the tree, parents, message, and all six identity values. Fix all of them (as the examples do) and the same content produces the same hash on every machine. The time zone is part of the value, so use an explicit offset or Z.
  • Display. %an, %ae, %ad in --format print the author, %cn, %ce, %cd the committer. --format=fuller shows both, --date=iso, short, relative, unix or format:... changes the style.
  • Tags have their own tagger identity, which follows the committer variables (GIT_COMMITTER_NAME, GIT_COMMITTER_EMAIL, GIT_COMMITTER_DATE).
  • Rewriting identities in bulk is a job for .mailmap (display only) or git filter-repo / git filter-branch (changes history and every hash).
  • Safety. Setting these in your shell profile impersonates nobody technically, since nothing verifies them. Signed commits and tags are what prove authorship. Treat names and e-mails in history as claims.
  • Backdating via GIT_AUTHOR_DATE changes only recorded metadata. Hosting sites may show the committer or the author date depending on the view.