简体   繁体   English

git svn基于git分支创建一个新的svn分支

[英]git svn create a new svn branch based on a git branch

Is it possible to create an svn branch off of a git branch? 是否可以从git分支创建svn分支? That is, I currently interact with an svn repository using git-svn. 也就是说,我目前正在使用git-svn与svn存储库进行交互。 I've created a new git branch into which I've merged some new changes. 我创建了一个新的git分支,在其中合并了一些新的更改。 Now I want to push this branch to the svn repository, albeit into it's own svn branch so others may download this. 现在,我想将该分支推送到svn存储库,尽管将其推送到它自己的svn分支中,以便其他人可以下载它。 Plus I'd like to keep tracking that branch via my git branch. 另外,我想继续通过我的git分支跟踪该分支。

Is this possible? 这可能吗? I tried git svn branch, but it creates the branch off of the master, not my off of my branch... 我尝试了git svn branch,但是它创建的是master分支,而不是我的分支...

thanks to all! 谢谢大家! Rodrigo 罗德里戈

I tried git svn branch, but it creates the branch off of the master, not my off of my branch 我尝试了git svn branch,但是它创建的是master分支,而不是我的分支分支

That is actually correct. 这实际上是正确的。 Svn should have something to base your new branch upon. Svn应该有一些东西可以作为新分支的基础。 You should rebase your git-only changes onto that svn/newBranch and then dcommit it. 您应该将仅git的更改重新设置到该svn / newBranch上,然后将其提交。 Before doing dcommit you might check that you are pushing to the right svn branch by looking at the output of git svn info . 在执行dcommit之前,您可以通过查看git svn info的输出来检查是否要推送到正确的svn分支。

If you want your svn branch to be based on some other svn branch rather than master(trunk), you should check it out first (do git svn info again to check it all good) and do git svn branch from there. 如果您希望svn分支基于某个其他svn分支而不是master(trunk),则应先将其检出(再次执行git svn info以确保一切正常),然后从那里进行git svn branch

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM