通过git删除svn-Branch? [英] Delete a svn-Branch via git?

查看:108
本文介绍了通过git删除svn-Branch?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用git作为scm的选择,但必须使用svn-repo。我可以像这样创建一个svn-remote-branch:

  git svn分支the_branch 


但是我怎样才能删除远程分支?

解决方案

目前,使用git-svn删除SVN分支是不可能的。但是使用SVN删除分支很容易,甚至不必检查它。因此,只需输入

  svn rm $ URL / branches / the_branch 

请注意,删除一个Subversion分支并不会导致它从git-svn仓库中被删除。 (这是故意的,因为删除一个Subversion分支不会导致任何信息丢失,而删除一个git分支会导致它的存在在下一个git垃圾回收之后被遗忘。)所以,如果你想从你的git中删除远程SVN分支仓库,你必须手动完成:

  git分支-D -r the_branch 
rm -rf .git / svn / the_branch


rm -rf .git / svn / refs / remotes / f8745 /(对于新版本)

$ b

要删除与Subversion标记对应的git分支,命令略有不同:

  git分支-D -r标签/ the_tag 
rm -rf .git / svn / tags / the_tag


I'am using git as scm of choice but have to use a svn-repo. I can create a svn-remote-branch like this:

git svn branch the_branch

But how can i delete the remote branch?

解决方案

Currently, it is not possible to delete an SVN branch using git-svn. But it is easy to delete the branch using SVN, without even having to check it out. So simply type

svn rm $URL/branches/the_branch

Please note that deleting a Subversion branch does not cause it to be deleted from the git-svn repository. (This is intentional, because deleting a Subversion branch does not cause any information loss, whereas deleting a git branch causes its existence to be forgotten following the next git garbage collection.) So if you want the remote SVN branch to be deleted from your git repository, you have to do it manually:

git branch -D -r the_branch
rm -rf .git/svn/the_branch

OR
rm -rf .git/svn/refs/remotes/f8745/ (for newer versions)

To delete a git branch that corresponds to a Subversion tag, the commands are slightly different:

git branch -D -r tags/the_tag
rm -rf .git/svn/tags/the_tag

这篇关于通过git删除svn-Branch?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆