有人推了一个分行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 fetch && git checkout your-branch-name
其他回答
使用 :
git checkout -b <BRANCH-NAME> <REMOTE-NAME>/<BRANCH-NAME>
其它答案在我的良性案例中不适用于现代 Git 。 如果远程分支是新的, 您可能需要先拉一下, 但我还没有检查过这个案例 。
git fetch && git checkout your-branch-name
从远程获取并检查分支。
git fetch <remote_name> && git checkout <branch_name>
例如:
git 获取来源 git 检出功能/ XYZ-1234- Add- 警告
首先,你需要做的是:
git fetch
如果你不知道 分支名称
git fetch origin branch_name
第二,您可通过下列方式检查远程分支进入本地 :
git checkout -b branch_name origin/branch_name
-b
将从您选中的远程分支中以指定的名称创建新分支 。
你基本上看到了树枝,但你还没有本地的拷贝!
你需要,你需要fetch
分支...
您可以简单地获取并退出分支, 使用下面的一条线命令来做到这一点 :
git fetch && git checkout test
我还创建了下面的图像 让你分享差异,看看如何fetch
以及它是如何与pull
: