Git无法在android studio中看到远程分支

我只有git的基础知识.

我只使用命令行和以下命令从我的远程克隆单个分支(存储库在克隆时有多个分支)

git clone <url> --branch <branch> --single-branch

我可以使用我的android-studio IDE vcs对克隆分支的支持来完成所有git操作.现在我想切换我的远程分支,但我的android-studio IDE没有显示远程分支.它只显示我曾经克隆过的一个分支.从我的搜索,我检查了以下解决方案,但不起作用.

Refresh remote Git branches in Android studio

如何在不从头开始克隆主分支的情况下获取远程分支列表?

解决方法:

你只看到一个分支,因为你使用了–single-branch

git documentation

–[no-]single-branch

Clone only the history leading to the tip of a single branch, either specified by the –branch option or the primary branch remote’s HEAD points at. Further fetches into the resulting repository will only update the remote-tracking branch for the branch this option was used for the initial cloning. If the HEAD at the remote did not point at any branch when –single-branch clone was made, no remote-tracking branch is created.

要撤消这个:

git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
git fetch origin

添加单个分支:

git remote set-branches --add origin [remote-branch]
git fetch origin [remote-branch]:[local-branch]

相关文章

Android性能优化——之控件的优化 前面讲了图像的优化,接下...
前言 上一篇已经讲了如何实现textView中粗字体效果,里面主要...
最近项目重构,涉及到了数据库和文件下载,发现GreenDao这个...
WebView加载页面的两种方式 一、加载网络页面 加载网络页面,...
给APP全局设置字体主要分为两个方面来介绍 一、给原生界面设...
前言 最近UI大牛出了一版新的效果图,按照IOS的效果做的,页...