git 列出和切换/检出到远程分支错误

lsmd5eda  于 2023-01-15  发布在  Git
关注(0)|答案(1)|浏览(180)

git ls-remote origin列出了所有远程节点及其提交ID,

xxxx41   refs/heads/ABC
xxxx92   refs/heads/dummy_xyz
xxxx32   refs/heads/Feature/ABC
xxxx77   refs/heads/Feature/ABC-mgc

现在,当我结帐到任何分支,我得到一个错误

error: pathspec "/Feature/ABC" or "/Feature/ABC-mgc" did not match any files known to git

我遵循了堆栈Remote branch not found上的一些问题
@schwern做了很好的解释,但是我不能退房。

djp7away

djp7away1#

尝试先获取分支:

git fetch
git checkout {the branch that you want}

相关问题