我试图从我的 fork 存储库中 checkout 一个分支,但它给出了一个错误:
存储库:https://github.com/tmsblgh/codechecker/tree/issue799
MacBook-Pro:codechecker tmsblgh$ git branch -vv
* master acdc482 [origin/master] Merge pull request #1636 from gyorb/version68
MacBook-Pro:codechecker tmsblgh$ git --version
git version 2.17.1
MacBook-Pro:codechecker tmsblgh$ git fetch
MacBook-Pro:codechecker tmsblgh$ git checkout issue799
error: pathspec 'issue799' did not match any file(s) known to git.
Baloghs-MacBook-Pro:codechecker tmsblgh$ git remote -v
origin https://github.com/tmsblgh/codechecker.git (fetch)
origin https://github.com/tmsblgh/codechecker.git (push)
MacBook-Pro:codechecker tmsblgh$ git checkout issue799
error: pathspec 'issue799' did not match any file(s) known to git.
最佳答案
本地存储库似乎没有 origin/issue799
。
#fetch the branch
git fetch origin issue799
#see if origin/issue799 exists
git branch -a
#if yes
git checkout issue799
#if not, create the local branch from FETCH_HEAD
git checkout -b issue799 FETCH_HEAD
#the next push after you make some new commits
git push -u origin issue799
关于git - 无法从 GitHub fork 存储库 check out 分支,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50764838/