使用受限分支克隆后更改 git(-svn) 中的远程跟踪分支

发布于 2024-12-04 18:51:34 字数 717 浏览 0 评论 0原文

当将远程分支限制为 2 或 3 个列表(编辑 .git/config,如 {^1} 中所示)、重新获取、垃圾收集和清理所有“refs”目录时,我仍然可以获得所有远程分支的完整列表 < code>git Branch -avv {^2}

我希望将 v2 和 v3 仅视为远程分支列表中的分支。 有什么想法如何解决这个问题吗?或者这是呈现我们可能使用或不使用的所有远程分支的“git 方式”?

{^1}

[svn-remote "svn"]
url = https://example.com/svn/repos/MyRepo/SubPath
fetch = trunk:refs/remotes/trunk
branches = branches/{v2,v3}:refs/remotes/*

{^2}

* master         1234 [trunk: ahead 1] last msg master
  remotes/v1     2345 last msg svn branch v1
  remotes/v2     3456 last msg svn branch v2
  remotes/v3     4567 last msg svn branch v3
  remotes/v4     5678 last msg svn branch v4
  remotes/trunk  6789 last msg svn trunk

When restricting remote branches to a list of 2 or three (editing the .git/config as seen in {^1}), refetching, carbage collectioning and cleaning all "refs" directories I still get a full list of all remote branches with git branch -avv {^2}

I expected to see v2 and v3 only as branches in the list of remote branches.
Any ideas how to fix this? Or is that the "git way" to present all remote branches either we might work with or not?

{^1}

[svn-remote "svn"]
url = https://example.com/svn/repos/MyRepo/SubPath
fetch = trunk:refs/remotes/trunk
branches = branches/{v2,v3}:refs/remotes/*

{^2}

* master         1234 [trunk: ahead 1] last msg master
  remotes/v1     2345 last msg svn branch v1
  remotes/v2     3456 last msg svn branch v2
  remotes/v3     4567 last msg svn branch v3
  remotes/v4     5678 last msg svn branch v4
  remotes/trunk  6789 last msg svn trunk

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

魔法少女 2024-12-11 18:51:34
git branch -D -r remotes/v1 remotes/v4 remotes/trunk
rm -rf .git/svn/refs/remotes/{v1,v4,trunk}
git branch -D -r remotes/v1 remotes/v4 remotes/trunk
rm -rf .git/svn/refs/remotes/{v1,v4,trunk}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文