5

This is my first setup of a repo on GitHub. I am running Linux, and my GitHub account has ssh-keys setup for my computer.

When I try to run git commit, I get this error.

git commit -m "examples"
*** 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 'j0h@sx.(none)')
j0h@sx:~/Learning-OpenCV-3_examples$   git config --global user.email "[email protected]"

What I do not understand is which name(s) and identity this is asking for when it says git config --global user.name "Your Name" does that mean the name on my PC? Or my GitHub username? Or my email username? Or something else?

I have tried a variety of combinations, but I still cannot commit via the command line.

1 Answer 1

5

Two issues here:

Setting Your Git Identity

First, your identity should be simply your full name and email address which could be your GitHub username and email combo. But this is not a verification stage as much as a “tag” to identify you; this has nothing to do directly with your GitHub username unless they are indeed one and the same.

So perhaps your version of those commands would be:

git config --global user.email "[email protected]"
git config --global user.name "jOh"

And then check those values like this:

git config -l

Output should be something like this; modified version of my own output for that command so the credential.helper and core.editor settings might be different for you:

credential.helper=osxkeychain
user.name=jOh
[email protected]
core.editor=nano

Adding Files and Making a Commit

But then you say this:

When I try to run git commit, I get this error.

git commit -m "examples"

Well, that command is missing the -a which is an alias for --all which means the following according to the man page for git-commit:

Tell the command to automatically stage files that have been modified and deleted, but new files you have not told Git about are not affected.

So the command would be:

git commit -a -m "examples"

And if you have not already added files to the repository, you would run git add for the specific file:

git add [filename]

Or maybe just use a wildcard to get all files set:

git add *

And then run the git commit command like this:

git commit -a -m "examples"
1
  • 1
    Huge relief, its working now. I was confused by the argument list style user.name.. thanks for clarifying.
    – j0h
    Commented Jan 12, 2017 at 3:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .