有人推了一个分行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)
当前回答
我用了那个:
git clean -fxd # removes untracked (new added plus ignored files)
git fetch
git checkout {branchname}
git reset --hard origin/{branchname} # removes staged and working directory changes
其他回答
我尝试了上面的解决方案,但行不通。试试这个,它奏效了:
git fetch origin 'remote_branch':'local_branch_name'
这将获取远程分支, 并创建一个新本地分支( 如果尚未存在) 名称local_branch_name
并追踪其中的遥控者。
git 检出 -b "Branch_name" [B 意指创建本地分支]
git 分支-all
git 检出 -b “您的分支名称”
git 分支分支
git 拖拉源 "您的分支名称"
从母版分支向 dev 分支成功退出
使用 :
git checkout -b <BRANCH-NAME> <REMOTE-NAME>/<BRANCH-NAME>
其它答案在我的良性案例中不适用于现代 Git 。 如果远程分支是新的, 您可能需要先拉一下, 但我还没有检查过这个案例 。
如果该分支所在的事物上不是其他的,origin
我喜欢做以下工作:
$ git fetch
$ git checkout -b second/next upstream/next
这将检出next
分支上upstream
远程连接到一个本地分支,该分支被调用second/next
。这意味着,如果您已经拥有下一个命名为本地分支的分支,则不会发生冲突。
$ git branch -a
* second/next
remotes/origin/next
remotes/upstream/next
在我看来,没有人建议 最简单的方法(也许我太笨了 觉得这太蠢了)"一种方式"但无论如何,试试这个:
git pull origin remoteBranchName
git switch remoteBranchName
这对我也有效(在我最后一次拉拉请求后,在遥控器上创建了一个分支)。