Git: “please tell me who you are” error

前端 未结 21 1454
傲寒
傲寒 2020-11-30 16:21

I have app servers that I bootstrap together using Chef + some ad-hoc bash scripts. The problem is, when I want to run an update on one of these app servers, I get:

相关标签:
21条回答
  • 2020-11-30 16:53
    git config user.email "insert github email here"
    git config user.name "insert github real name here"
    

    This worked great for me.

    0 讨论(0)
  • 2020-11-30 16:53

    IMHO, the proper way to resolve this error is to configure your global git config file.

    To do that run the following command: git config --global -e

    An editor will appear where you can insert your default git configurations.

    Here're are a few:

    [user]
        name = your_username
        email = your_username@users.noreply.github.com 
    [alias]
        # BASIC
        st = status
        ci = commit
        br = branch
        co = checkout
        df = diff
    

    For more details, see Customizing Git - Git Configuration

    When you see a command like, git config ...

    $ git config --global core.whitespace \
        trailing-space,space-before-tab,indent-with-non-tab
    

    ... you can put that into your global git config file as:

    [core]
       whitespace = space-before-tab,-indent-with-non-tab,trailing-space
    

    For one off configurations, you can use something like git config --global user.name 'your_username'

    If you don't set your git configurations globally, you'll need to do so for each and every git repo you work with locally.

    The user.name and user.email settings tell git who you are, so subsequent git commit commands will not complain, *** Please tell me who you are.

    Many times, the commands git suggests you run are not what you should run. This time, the suggested commands are not bad:

    $ git commit -m 'first commit'
    
    *** Please tell me who you are.
    
    Run
    
      git config --global user.email "you@example.com"
      git config --global user.name "Your Name"
    
    

    Tip: Until I got very familiar with git, making a backup of my project file--before running the suggested git commands and exploring things I thought would work--saved my bacon on more than a few occasions.

    0 讨论(0)
  • 2020-11-30 16:54

    In my case I was missing "e" on the word "email" as Chad stated above but I see its not the case with you. Please hit the following command to see if everything is pulling as expected.

    git config -l
    
    0 讨论(0)
  • 2020-11-30 16:54

    Same issue was with me and resolved it by adding default name and email Repository Settings.

    As Doron suggested -

    If you are using sourcetree: Repository -> Repository Settings --> Advanced --> uncheck "Use global user settings" box.

    Add default name and email address.

    0 讨论(0)
  • 2020-11-30 16:54

    To fix I use: git config --global user.email "you@example.com" and works.

    user.mail no work, need to put an E. Typo maybe?

    0 讨论(0)
  • 2020-11-30 16:55

    I spent lots of hours on it when I call PHP script to init and commit to git. And I found the work flow should be as:

    1. git init
    2. git config user.name "someone"
    3. git config user.email "someone@someplace.com"
    4. git add *
    5. git commit -m "some init msg"

    If you swap [23] and 1, the config will not work at all.

    I wish this will do some help.

    0 讨论(0)
提交回复
热议问题