Search code examples
gitgithubintellij-idea

Can't finish github sharing process


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 "[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. unable to auto-detect email address (got 'Owner@****.(none)')


Solution

  • 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 [email protected]
    

    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.