How to make an existing git branch track the remote SVN branch?

Like this question , how can I make an existing Git tracking branch a remote SVN branch?

I often find that I am starting work in a local branch, and then I need to click on the SVN server. Is it possible?

+4
source share
1 answer

The idea is to click on an existing SVN branch.

The value you need:

  • to git svn rebase existing SVN branch (called git-svn-branch 'here)
  • git branch -b work # new work branch
  • Work...
  • git checkout git-svn-branch and git svn rebase (make sure the wizard is updated)
  • git checkout work and git rebase git-svn-branch (repeat your work on the git rebase git-svn-branch )
  • git checkout git-svn-branch and git merge work (upgrade git-svn-branch HEAD to work HEAD )
  • git svn dcommit (move the git svn dcommit branch to the SVN repo with the rights to work included)

You will find the same process in this SO question .

So, in short, when you are working with the local Git branch and want to redirect it to the SVN branch, you first need to import this SVN branch into the local 'git-svn' branch, and then reformat / merge your local branch on it.
You cannot directly push the local Git branch on the remote SVN server.

+3
source

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


All Articles