git 拉取远程分支报错(fatal: '' is not a commit and a branch '' cannot be created from it)

时间:2021-04-05 02:00:53

问题描述
从远程git上拉取某一个分支,然后报错,拉取不了这个分支。
拉取分支的命令:

git checkout -b xxx-static-19 origin/xxx-static-19

其中xxx-static-19是分支名。

报错

fatal: 'origin/xxx-static-19' is not a commit and a branch 'xxx-static-19' cannot be created from it

解决
重新拉取数据,git pull ,然后再切回分支