如何重新创建 git svn 远程跟踪分支?
我使用 git 作为 SVN 存储库的接口。现在我已经创建了一个 SVN 分支:
git svn branch my_branch
这在我的 SVN 存储库中创建了目录,并且还创建了一个名为remotes/my_branch 的分支。然后我删除了该远程跟踪分支:
git branch -r -d my_branch
现在该目录仍然存在于 SVN 存储库中,但我似乎找不到恢复远程跟踪分支的方法。有什么想法吗?我尝试
git svn branch my_branch
=> branch test_new_mod_named already exists
使用 git svn Reset 等,但无济于事。
I'm using git as an interface to an SVN repository. Now I've created a SVN branch:
git svn branch my_branch
This created the directory in my SVN repository, and also created a branch called remotes/my_branch. Then I've deleted that remote tracking branch:
git branch -r -d my_branch
Now the directory is still there in the SVN repository, but I can't seem to find a way to get the remote tracking branch back. Any idea? I tried
git svn branch my_branch
=> branch test_new_mod_named already exists
and played around with git svn reset, etc. to no avail.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现最简单的方法是使用 svn 在
my_branch
中进行提交,然后再执行另一个git svn fetch
。远程分支存在:
删除分支:
分支消失了。现在尝试 git svn fetch 重新创建它:
没有任何反应,直到有人这样做......
并进行提交。瞧:
远程分支回来了。
The easiest way I found to be making a commit in
my_branch
using svn, and then doing anothergit svn fetch
.Remote branch is there:
Delete branch:
And branch is gone. Now try a git svn fetch to recreate it:
Nothing happens, until somebody does this...
... and makes a commit. Voila:
Remote branch is back.