【发布时间】:2021-09-12 12:53:24
【问题描述】:
bitbucket 上有一个存储库,我有一个分支。
当我写:git branch -a 时,我只得到我当前的分支,它没有列出其他分支。
当我写git checkout branch_name 时,我得到:error: pathspec 'branch_name' did not match any file(s) known to git。
git remote show origin:
* remote origin
Fetch URL: ssh:URL
Push URL: ssh:URL
HEAD branch: master
Remote branch:
branch_name tracked
Local branch configured for 'git pull':
branch_name merges with remote branch_name
Local ref configured for 'git push':
branch_name pushes to branch_name (up to date)
git branch --all -vv
* branch_name {an id} [origin/branch_name] A commit
remotes/origin/branch_name {an id} A commit
【问题讨论】:
-
git remote -vv显示什么?它是否显示您的 bitbucket 存储库的 URL?您是从该存储库克隆还是在本地初始化了一个空存储库? -
是的,它显示了 URL。我克隆了它。
-
请在您的问题中提供
git branch --all -vv和git remote show origin的实际输出 -
尝试
git fetch然后git checkout
标签: git