[英]why i can't see the new remote branch on my localhost after git fetch --all?
Hello everyone.大家好。 yesterday, my boss created a new remote branch that i should have after, but when i use
git fetch --all
, on my local host, i just have the ancient branches that i had before, and i can't switch to the new created branch because i can't see it in my local host.昨天,我的老板创建了一个我应该拥有的新远程分支,但是当我使用
git fetch --all
时,在我的本地主机上,我只有以前拥有的古老分支,我无法切换到新分支创建了分支,因为我在本地主机中看不到它。
This is a picture to show you what i tried to do:这是一张图片,向您展示我尝试做的事情:
so my question is so clear, how can i see the remote branch in my local host?所以我的问题很清楚,我怎样才能在本地主机中看到远程分支? Thanks.
谢谢。
By default, git branch
only shows your local branches.默认情况下,
git branch
仅显示您的本地分支。 Use git branch -r
to show remote tracking branches, or git branch -a
to show all brandches.使用
git branch -r
显示远程跟踪分支,或git branch -a
显示所有品牌。
The solution is, after doing git fetch --all
you must do git switch NameOfNewBranch
for switching to the new remote branch and to work on it.解决方案是,在执行
git fetch --all
之后,您必须执行git switch NameOfNewBranch
以切换到新的远程分支并进行处理。
Thanks for Korashen !感谢科拉申!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.