Git's Fatal Please Tell Me Who You Are Error |Video upload date:  · Duration: PT11M34S  · Language: EN

Quick guide to resolve Git author identity unknown error by setting user.name and user.email and amending commits when needed

Why Git will yell at you about author identity

You try to commit and Git slaps you with a fatal error asking who you are. That is Git playing hard to get about author identity. Every commit needs a name and an email so version control can track who broke what and who to blame later.

Check your current Git identity

First, see what the repo already knows about you. If nothing prints you get the lovely anonymous contributor experience.

git config user.name
git config user.email

Set a global name and email for your machine

If you are on a personal laptop and want to stop fixing this every five minutes use global settings. These become the defaults for all repositories on that machine.

git config --global user.name "Your Name"
git config --global user.email "you@example.com"

This is the usual blessing for personal work. Use an email that matches your hosting account to get avatars and less mystery in contributor lists.

Set a repo specific identity for work or shared machines

If you juggle work and personal accounts set identity inside the repository. Local repo config overrides global config without drama.

cd path/to/repo
git config user.name "Work Name"
git config user.email "work@example.com"

Amend a previous commit that used the wrong author

If you already committed with the wrong identity you can fix it. This rewrites history so be polite and check with your team before pushing.

git commit --amend --reset-author
# then, if you need to update the remote
git push --force-with-lease

Use care when rewriting public history unless your team enjoys surprise reverts.

Fix CI and automated environments

Continuous integration systems do not have feelings and will not infer your name. Configure the environment so automated commits include an author identity.

  • Many CI systems support environment variables like GIT_AUTHOR_NAME and GIT_AUTHOR_EMAIL
  • Or run a quick global config step in the CI job before committing
export GIT_AUTHOR_NAME="CI Builder"
export GIT_AUTHOR_EMAIL="ci@example.com"
# or
git config --global user.name "CI Builder"
git config --global user.email "ci@example.com"

Quick recap

  • Check current settings with git config user.name and git config user.email
  • Set global identity for personal machines with git config --global
  • Set repo level identity for work or shared machines with git config inside the repo
  • Fix bad commits with git commit --amend --reset-author and push with care
  • Configure CI with environment variables or a pre commit setup so automation does not produce git errors

That is it. Give Git a name and an email and it will stop yelling. You will get cleaner version control history and fewer mysterious contributors to blame in the future.

I know how you can get Azure Certified, Google Cloud Certified and AWS Certified. It's a cool certification exam simulator site called certificationexams.pro. Check it out, and tell them Cameron sent ya!

This is a dedicated watch page for a single video.