16

I am following the official guide of GIT, and actually I am at 2.2.6 paragraph " Committing Your Changes" Previously, at section 1.5.1 "Identity" when asked to enter a command like

git config --global user.name "John Doe"

I missed the --global option because I don't need it. Now everytime I do a git commit, I obtain

$git commit

*** 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.

but I do not want to enter a --global option, does exist another way?

5
  • Did you set both user.email and user.name? Can you show the contents of .git/config for your project? Commented Mar 13, 2013 at 17:43
  • 1
    You have the answer in your question: Omit --global to set the identity only in this repository. Commented Mar 13, 2013 at 17:48
  • 1
    @CarlNorum [user] name = Caterpillar email = [email protected] Commented Mar 13, 2013 at 17:57
  • Are you sure that's from the same repo where you're trying to do the commit? Commented Mar 13, 2013 at 18:01
  • @CarlNorum Yes, it is the first time I use it and I don't have any other repos Commented Mar 13, 2013 at 18:03

3 Answers 3

25

If you just want to set it for that repository, run:

git config user.email "[email protected]"
git config user.name "Your Name"
Sign up to request clarification or add additional context in comments.

1 Comment

If using a shared (cloud) build machine for which we don't want to set the identity globally or locally for the repo, how can it be specified just for the single commit command?
6

Just type the same name that you have in your GitHub account, the same the same letters and character.

GitHub account name

git user.name

Comments

2

This is Solving

1- git init
2- git config user.name "AccountName"
3- git config user.email "yourGamil"
4- git add *
5- git commit -m "WriteCommit"
6- git push origin master

2 Comments

This doesn't really address the question.
@Andy J, it did solve my problem on my mac m1. inside a dir named github/ I did the git init and all the other steps up til the 3rd. It worked like a charm.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.