Why does Git on my PC display the follwing messages when I try to commit a file

When I’m on Git on my PC and use the commit command, I get the message below. Please can someone kindly explain this message and how I can resolve the issue.

Thank you.

"myPC@MyPC-PC MINGW64 ~/Desktop/gitfold (master)
$ git commit -m “the last one”

*** Please tell me who you are.


git config --global user.email “you@example.com
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 ‘myPC@MyPC-PC.(none)’)

myPC@MyPC-PC MINGW64 ~/Desktop/gitfold (master)"

Hi there.

Git looks for some basic identifying information about you, so that it can record who is responsible for committing to the repository.

I think the reason you’re seeing that error is because Git can’t automatically determine a value for your name and/or email address; both of which are recorded in commit messages.

Here’s an example from the git log of one of my repos:

commit 623202099d8ffa677a1035591e7249de8977376f
Author: my name <my email address would be here>
Date:   Thu Feb 25 19:05:47 2021 +0000

    removed debug code

There’s some excellent help on setting these properties available from GitHub here. :slight_smile:

Many thanks. It’s clear now. I understand the credentials weren’t setup before using Git.

1 Like