更新远程分支的 git-svn 列表

发布于 2024-08-19 11:42:07 字数 305 浏览 8 评论 0原文

当我必须使用 svn 时,我使用 git-svn 与 svn 对话。我使用标准 git svn clone -s 行克隆了存储库,当时所有的远程分支都在那里。

从那时起,一个新的分支就被创建了,但不是由我创建的。我想在本地检查/跟踪这个分支。我可以跟踪我可以看到的分支(使用 gitbranch -r),如下所示:

git checkout -t -b dev remotes/development

但这不适用于其他分支,因为它没有显示在 gitbranch -r 中

如何跟踪这个丢失的分支?

When I have to use svn, I use git-svn to talk to svn. I cloned the repo with the standard git svn clone -s line, and all the remote branches at the time were there.

Since then, a new branch has been created, but not by me. I want to checkout/track this branch locally. I can track a branch that I can see (with git branch -r) like so:

git checkout -t -b dev remotes/development

But this doesn't work with the other branch, since it doesn't show up in git branch -r

How can I track this missing branch?

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

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

发布评论

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

评论(3

驱逐舰岛风号 2024-08-26 11:42:07

运行以下命令后,您将能够在 git 端看到新分支:

$ git svn fetch
$ git svn rebase

首先确保您的分支是干净的。

After running the following commands, you'll be able to see the new branch on the git side:

$ git svn fetch
$ git svn rebase

Make sure your branch is clean first.

意中人 2024-08-26 11:42:07
git svn rebase

将变基当前分支,并且您指定的所有分支应自动提取到本地存储库配置中。

git svn fetch

将从 SVN 存储库中获取所有分支,如您最初执行 git svn 克隆时所述(包括新分支)。这与仅获取您指定的分支的行为形成鲜明对比

git fetch

,如git svn rebase

这种差异主要是因为 git 无法“看到”SVN 远程分支,直到它们被拉入本地存储库,而当您克隆 git 存储库并且 gitbranch -a 显示所有远程分支时(即使是那些未被跟踪/不会通过获取进行更新的数据)。

git svn rebase

will rebase the current branch and all the branches that you have indicated should be automatically fetched in your local repository configuration.

git svn fetch

will fetch all the branches from the SVN repository as described when you originally did the git svn clone (including new ones). This is in contrast to the behaviour of

git fetch

which only fetches the branches you've specified, as with the git svn rebase.

This difference is primarily because git can't "see" the SVN remotes branches until they've been pulled into the local repository vs when you clone a git repository and git branch -a shows all the remote branches (even those that aren't tracked/won't be updated with a fetch).

铜锣湾横着走 2024-08-26 11:42:07

git svn rebase --fetch-all 将解决它,请参阅 手册页

这会从 SVN 获取修订版本
当前 HEAD 和 rebase 的父级
当前(未提交 SVN)工作
反对它。

[...]

这与 svn update 或 git pull 类似

[...]

这接受 git svn fetch 和 git rebase 接受的所有选项。但是,--fetch-all 仅从当前的 [svn-remote] 中获取,而不是从所有 [svn-remote] 定义中获取。

:i: 但它获取所有 svn 副本/分支

git svn rebase --fetch-all will tackle it, refer to the man page:

This fetches revisions from the SVN
parent of the current HEAD and rebases
the current (uncommitted to SVN) work
against it.

[...]

This works similarly to svn update or git pull

[...]

This accepts all options that git svn fetch and git rebase accept. However, --fetch-all only fetches from the current [svn-remote], and not all [svn-remote] definitions.

:i: BUT it fetches all svn copies / branches

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文