更新远程分支的 git-svn 列表
当我必须使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
运行以下命令后,您将能够在 git 端看到新分支:
首先确保您的分支是干净的。
After running the following commands, you'll be able to see the new branch on the git side:
Make sure your branch is clean first.
将变基当前分支,并且您指定的所有分支应自动提取到本地存储库配置中。
将从 SVN 存储库中获取所有分支,如您最初执行 git svn 克隆时所述(包括新分支)。这与仅获取您指定的分支的行为形成鲜明对比
,如git svn rebase。
这种差异主要是因为 git 无法“看到”SVN 远程分支,直到它们被拉入本地存储库,而当您克隆 git 存储库并且 gitbranch -a 显示所有远程分支时(即使是那些未被跟踪/不会通过获取进行更新的数据)。
will rebase the current branch and all the branches that you have indicated should be automatically fetched in your local repository configuration.
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
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).
git svn rebase --fetch-all
将解决它,请参阅 手册页::i: 但它获取所有 svn 副本/分支
git svn rebase --fetch-all
will tackle it, refer to the man page::i: BUT it fetches all svn copies / branches