Similar to this question, how can I make an existing Git branch track a remote SVN branch?
I often find that I start work in a local branch that I then need to push to an SVN server. Is this possible?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The idea remains to push to an existing SVN branch.
Meaning you need:
git svn rebasean existing SVN branch (called here ‘git-svn-branch‘)git branch -b work# new working branchgit checkout git-svn-branchandgit svn rebase(make sure master is up-to-date)git checkout workandgit rebase git-svn-branch(replay your work on top of the git-svn branch)git checkout git-svn-branchandgit merge work(updategit-svn-branch HEADtowork HEAD)git svn dcommit(push back the git-svn branch to SVN repo, with work commits included in it)You will find that same process in this SO question.
So, in short, when you are working on a local Git branch, and you want to push it to an SVN branch, you need first to import that SVN branch to a ‘git-svn’ local branch, and then rebase/merge your local branch on it.
You cannot directly push your local Git branch on an SVN remote one.