Git: “please tell me who you are” error

前端 未结 21 1452
傲寒
傲寒 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:33

    git pull should not require this. However if the pull causes a merge conflict, then it seems nessecary.

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

    I ran into this error message whilst trying to commit some files.

    Simply running git fetch then trying my commit again worked for me.

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

    Instead of doing a git pull, you can do:

    git fetch
    git reset --hard origin/master
    

    Neither of those require you to configure your git user name / email.

    This will destroy any uncommitted local changes / commits, and will leave your HEAD pointing to a commit (not a branch). But neither of those should be a problem for an app server since you shouldn't be making local changes or committing to that repository.

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

    Update your bootstrap process to create a ${HOME}/.gitconfig with the proper contents, or to copy an existing one from somewhere.

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

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

    worked great for me.

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

    i use heroku cli 1. must use all user name and user email

    $git config --global user.email .login email.

    $git config --global user.name .heroku name.

    1. git pull [git url]
    2. git init
    3. git add *

      5 git commit -m "after config user.name ,user email"

    4. git push heroku master

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