Git: “please tell me who you are” error

前端 未结 21 1660
傲寒
傲寒 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

    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.

提交回复
热议问题