Create an SVN Branch from an Existing Git Branch

I already cloned an existing SVN project through git svn clone without any problems, but at the same time I only created the branch in Git (not SVN), and now I would like to synchronize this branch back to the SVN branch (and not to the chest).

I created a branch a while ago. Is it possible to return information stored in this Git branch to SVN?

+4
source share
1 answer

You can create a new branch in Subversion using git svn branch . You can look at an example in this answer:

In particular, good advice in a related tutorial is to use the --dry-run option for svn dcommit to verify that when you run the command for the real one, it will click on the right branch.

The Pro Git book has a clearer description of how git svn dcommit decides which svn branch to upgrade. It seems to me that you need:

  • Create a new svn branch using git svn branch new-experiment
  • Create a local branch to track remotes/new-experiment with git checkout --track -b new-experiment remotes/new-experiment
  • Restore the changes from the old Git theme thread (suppose it's called experiment ) to new-experiment :

      git checkout experiment git branch original-experiment git rebase new-experiment git checkout new-experiment git merge experiment 
  • Try git svn dcommit --dry-run to check if the branch of the correct subversion branch will be changed.
  • If yes, then git svn dcommit
+5
source

Source: https://habr.com/ru/post/1343289/


All Articles