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

Git无法在android studio中看到远程分支,第1张

概述我只有git的基础知识.我只使用命令行和以下命令从我的远程克隆单个分支(存储库在克隆时有多个分支)gitclone<url>--branch<branch>--single-branch我可以使用我的android-studioIDEvcs对克隆分支的支持来完成所有git *** 作.现在我想切换我的远程分支,但我的android-studi

我只有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]
总结

以上是内存溢出为你收集整理的Git无法在android studio中看到远程分支全部内容,希望文章能够帮你解决Git无法在android studio中看到远程分支所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/web/1119614.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-29
下一篇 2022-05-29

发表评论

登录后才能评论

评论列表(0条)

保存