【问题标题】:listing and switching /checkout to remote branch error列出并切换 /checkout 到远程分支错误
【发布时间】:2023-01-13 23:44:31
【问题描述】:

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 做了精彩的解释,但我无法结帐。

【问题讨论】:

    标签: git remote-branch


    【解决方案1】:

    尝试先获取分支:

    git fetch
    git checkout {the branch that you want}
    

    【讨论】:

      猜你喜欢
      • 2011-10-19
      • 1970-01-01
      • 2017-07-22
      • 2021-06-21
      • 2021-08-22
      • 2020-06-30
      • 2012-08-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多