-1

I am using Linux OS on Chromebook. I'm learning Java. I downloaded a repository from GitHub. It lacked of .gitignore file, so I created it and I'm trying to commit it, but I get a message

$ git commit -m "I've created .gitignore file"

*** Please tell me who you are.

Run

  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: empty ident name (for <(null)>) not allowed

I've done that, I typed my GitHub email, and then my name and surname.

$ git config --global "my_GitHub_account_email@gmail.com" 
$ git config --global "Name Surname"

But when I type my name I get a message:

error: key does not contain a section: Name Surname

what am I doing wrong?

phd
  • 82,685
  • 13
  • 120
  • 165
anabanana
  • 49
  • 8
  • Can you update your question with the actual command you typed? – Mathieu Apr 24 '19 at 08:16
  • Can you have a look at your .gitconfig and see if it is correctly formed? – Mr. Wrong Apr 24 '19 at 08:45
  • $ cat .gitignore /bin/ .idea/* .classpath* .project* *.iml – anabanana Apr 24 '19 at 08:52
  • I've never used Linux system before, whatever I do is from what I've googled. I followed all steps from my course video. I also tried to create a text file, abc.txt. And it still brings the same error. – anabanana Apr 24 '19 at 09:07
  • Possible duplicate of [Git: "please tell me who you are" error](https://stackoverflow.com/questions/11656761/git-please-tell-me-who-you-are-error) – phd Apr 24 '19 at 09:27
  • https://stackoverflow.com/search?q=%5Bgit%5D+Please+tell+me+who+you+are – phd Apr 24 '19 at 09:27

2 Answers2

0

You are running the git config --global user.name "Your Name" without double apex ", like this:

git config --global user.name my name and username

run like this

git config --global user.name "my name and username"
0

You typed

$ git config --global "my_GitHub_account_email@gmail.com" 
$ git config --global "Name Surname"

You forget user.name and user.email.

The commands you have to type are:

$ git config --global user.email "my_GitHub_account_email@gmail.com" 
$ git config --global user.name "Name Surname"
Mathieu
  • 8,840
  • 7
  • 32
  • 45