有人推了一个分行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)
当前回答
如果该分支所在的事物上不是其他的,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
其他回答
如果该分支所在的事物上不是其他的,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
使用使用fetch
以拉动全部远程
git fetch --all
要列出远程分支 :
git branch -r
列出您所有的分支
git branch -l
>>outpots like-
* develop
test
master
要取出/更改分支
git checkout master
运行这两个命令,你应该可以去。
git checkout <branch-name>
git pull <remote> <branch-name>
git branch -r
表示对象名称无效, 因为该分支名称不在 Git 的本地分支列表中。 更新您的本地分支列表来源 :
git remote update
然后再试着检查一下你的远程分支
这对我管用
我相信git fetch
拉拉进全部( 全部)远端树枝,这不是最初的海报所要的。
从远程获取并检查分支。
git fetch <remote_name> && git checkout <branch_name>
例如:
git 获取来源 git 检出功能/ XYZ-1234- Add- 警告