1

I'm trying to share one of my IntelliJ projects on GitHub, but whenever I try to do that, I get an error that says it successfully created the project but initial commit failed. It gives me instructions on how to fix this, but I have no idea what the instructions mean. Can anyone decipher the error and tell me what to do?

Here is the error:

Can't finish GitHub sharing process
Successfully created project 'basic-program' on GitHub, but initial commit failed:
*** 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. unable to auto-detect email address (got 'Owner@****.(none)')

suz_m
  • 35
  • 1
  • 6
  • Have you tried running the command from the error message (i.e. git config ...)? – dunni Feb 23 '21 at 21:40
  • Please include the error message as text next time and add the picture ogtionally for clarification. That way other people will be able to find your Question and the answers when they search for the exact error. – jessehouwing Feb 23 '21 at 22:39

1 Answers1

3

Basically, before you can create a commit, git needs to know who you are and how to refer to you. To tell git who you are, run the following commands.

Set the user name:

git config --global user.name "Firstname Lastname"

Set the email:

git config --global user.email your@email.address

After that you will be able to create commits. Probably you can just rerun whatever you did that lead to this error.

Further reference for git config command

--global will make every git repository on your local machine for the current user use this (e.g. user.name) value. Overrides system config if this value is set.

--local (or just nothing, since this is the default) will make only the current git repository on your local machine use this (e.g. user.name) value. Overrides global and system config if this value is set.

--system will make every git repository on your local machine for all users use this (e.g. user.name) value.

rhymefororange
  • 341
  • 1
  • 7