有人推了一个分行test
与git push origin test
共享仓库的共享仓库。git branch -r
如何查看遥控器test
我试过了
git checkout test
,它没有做任何事情git checkout origin/test
给给* (no branch)
有人推了一个分行test
与git push origin test
共享仓库的共享仓库。git branch -r
如何查看遥控器test
我试过了
git checkout test
,它没有做任何事情git checkout origin/test
给给* (no branch)
当前回答
我被困在一个状况中看到error: pathspec 'desired-branch' did not match any file(s) known to git.
以上所有建议。我正在讨论Git 1.8.3.1版本。
所以这个为我工作:
git fetch origin desired-branch
git checkout -b desired-branch FETCH_HEAD
背后的解释是,我注意到 当我拿起遥控树枝时,时前:
git fetch origin desired-branch
From github.com:MYTEAM/my-repo
* branch desired-branch -> FETCH_HEAD
其他回答
git branch -r
表示对象名称无效, 因为该分支名称不在 Git 的本地分支列表中。 更新您的本地分支列表来源 :
git remote update
然后再试着检查一下你的远程分支
这对我管用
我相信git fetch
拉拉进全部( 全部)远端树枝,这不是最初的海报所要的。
我尝试了上面的解决方案,但行不通。试试这个,它奏效了:
git fetch origin 'remote_branch':'local_branch_name'
这将获取远程分支, 并创建一个新本地分支( 如果尚未存在) 名称local_branch_name
并追踪其中的遥控者。
git 检出 -b "Branch_name" [B 意指创建本地分支]
git 分支-all
git 检出 -b “您的分支名称”
git 分支分支
git 拖拉源 "您的分支名称"
从母版分支向 dev 分支成功退出
缩略git remote show <origin name>
命令将列出所有分支(包括未跟踪的分支)。然后您可以找到要获取的远程分支名称。
示例:
git remote show origin
使用这些步骤获取远程分支 :
git fetch <origin name> <remote branch name>:<local branch name>
git checkout <local branch name > (local branch name should the name that you given fetching)
示例:
git fetch origin test:test
git checkout test
要克隆 Git 仓库, 需要 :
git clone <either ssh url /http url>
上述命令检查了所有分支,但只检查了master
将初始化分支。 如果您想要检查其它分支, 请做 :
git checkout -t origin/future_branch (for example)
此命令检查远程分支, 您的本地分支名称将与远程分支相同 。
如果您想要在检查退出时覆盖您的本地分支名称 :
git checkout -t -b enhancement origin/future_branch
现在您的本地分支名称是enhancement
,但您的远程分支名称是future_branch
.