git branch 没有显示所有的分支

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/47113509/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 05:11:05  来源:igfitidea点击:

git branch is not showing all the branches

git

提问by Mohit Malik

/opt/lampp/htdocs/drupal-8.4.0$ git branch

/opt/lampp/htdocs/drupal-8.4.0$ git 分支

I have installed drupal in my system ,I want to switch to other branch but when used git branch is not showing other branches !

我已经在我的系统中安装了 drupal,我想切换到其他分支,但是当使用 git branch 时没有显示其他分支!

回答by Irteza Asad

It might be a possibility that you don't have those branches locally.

您可能在本地没有这些分支机构。

to pull all additional branches,

拉动所有额外的分支,

git fetch

it should be like this not like above

应该是这样的 不像上面的

git fetch --all or git fetch <branch Name>

then you can use either checkoutor branchto check if it shows

然后您可以使用checkoutbranch检查它是否显示

git checkout name-of-the-branch
git branch

回答by Hoang Minh Dung

Execute git branch -avto show all remote and local branches.

执行git branch -av以显示所有远程和本地分支。

回答by slashpai

Use git branch -ato see all branches in repo and then you can use git checkout branchnameto checkout to respective branch

使用git branch -a看到回购所有分支,然后你可以使用git checkout branchname结账到各个分支

回答by Caio Sym

Do a git fetch first in order to pull aditional branch info from the remote

首先执行 git fetch 以从远程获取附加分支信息

回答by Irrfan23

do git branch -ait will give you all the branches in the remote. another option git fetch --allThen if you want to change or what operation you want to give you can do. example - if you want to change branch then git checkout <branch name from shown branches>

这样做git branch -a会给你远程的所有分支。另一个选项git fetch --all然后如果你想改变或者你想给你什么操作你可以做。示例 - 如果您想更改分支,则git checkout <branch name from shown branches>