git clone工程中的分支fatal: unable to auto-detect email address

仓库中有很多分支时,git clone 对应的URL只能clone下master主分支,这是需要新建对应的分支

git checkout -b POC #新建POC分支

再拉取对应的代码

git pull origin POC

遇见报错

fatal: unable to auto-detect email address 

查了一下,设置邮箱密码也还是一样

sudo git config --global user.email "[email protected]"
[sudo] password for ytj: 
ytj@ubuntu:~/PictorFaceSDK$ sudo git config --global user.name "yangjiang"

原来是没切换用户身份,运行su命令,输入密码,再拉取POC分支集问题解决

ytj@ubuntu:~/PictorFaceSDK$ git branch -d POC
error: Cannot delete the branch 'POC' which you are currently on.
ytj@ubuntu:~/PictorFaceSDK$ git checkout master 
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.
ytj@ubuntu:~/PictorFaceSDK$ git branch -d POC
Deleted branch POC (was b31e6b2).
ytj@ubuntu:~/PictorFaceSDK$ git branch -d ZK
Deleted branch ZK (was b31e6b2).
ytj@ubuntu:~/PictorFaceSDK$ git branch 
* master
ytj@ubuntu:~/PictorFaceSDK$ git checkout -b POC
Switched to a new branch 'POC'
ytj@ubuntu:~/PictorFaceSDK$ git pull origin POC
From code.orbbec.com.cn:liguanqun/PictorFaceSDK
 * branch            POC        -> FETCH_HEAD

*** 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.

fatal: unable to auto-detect email address (got 'ytj@ubuntu.(none)')
ytj@ubuntu:~/PictorFaceSDK$ sudo git config --global user.email "[email protected]"
[sudo] password for ytj: 
ytj@ubuntu:~/PictorFaceSDK$ sudo git config --global user.name "yangjiang"

你可能感兴趣的:(git)