Take the 2-minute tour ×

I'm running the git-svn client on my machine. I'd like to have a pattern similar to a standard git branching and merging pattern, wherein you have a development branch which was branched from trunk, and you have several feature or bug-fix branches that have extended from the development branch.

The problem I'm having is that I can't figure out how to make that all work with git-svn. I know that merging is a pain with vanilla subversion and that it's nice with vanilla git, but it's also turning out to be a pain with git-svn.

So.... what is the best practice? How can you branch and merge confidently and easily with git-svn? What is the development practices with it?

I would like to follow this pattern:

* Master
| * Development
| |\
| | * Feature
| | |
| | * a commit to feature
| |\|
| | * merge Development into Feature
| | |
| |/|
| * | merge Feature into Development
 ... etc

Any help would be greatly appreciated!!


Just to clarify - each git branch should correspond with an svn branch. This is a team workflow, where team members should be able to work on feature and bug fix branches.

share|improve this question
@sensonario, no SVN mentioned there –  Basilevs Nov 16 '13 at 11:21
As long as your work branch are purely in your local git repo, I don't see a problem. Create work branch, work, merge to master, dcommit back to svn. That's a pattern I use regularly. –  Frank Osterfeld Nov 16 '13 at 19:43
It's not, the git branches correspond to actual svn branches. This is a team workflow –  Mr A Nov 16 '13 at 22:33

1 Answer 1

In short:

  • branch server side
  • synchronize merge single direction (from trunk to branches/feature)
  • merge back (reintegrate) once for all (this will close the branch)

This my current recommended workflow with svn based on some notes. Words in between < and > are place holders.


T1: use the symbols "^/" to refer to your base repository. From anywhere in your project you can list against the repository with:

svn list ^/<repo_path>

T2: to now on which branch you are currently working use

svn info | grep URL


R1: do not checkout the top project dir (the one containing trunk/ branches/ and tag/) but the trunk dir itself, i.e.:

don't do:

svn checkout <BASE_URL>/svn/<proj>

but do:

svn checkout <BASE_URL>/svn/<proj>/trunk workdir

and use switch.

R2- When branching, always do it server side to avoid copying.


svn cp workdir/trunk workdir/branches/feature


svn cp ^/trunk ^/branches/feature

followed by:

cd <workdir_path>
svn sw ^/branches/feature

R3: only merge (synchronize) from trunk to your branch.

cd <workdir_path>
svn merge ^/trunk

R4: to merge on the other direction (from branch to trunk) use reintegrate merge.

svn up
svn switch ^/trunk
svn merge --reintegrate ^/branches/<feature>
(resolve conflicts and ...)
svn ci

Exception: If you need to cherry-pick a change to the trunk, you may preffer to do it with the --ignore-ancestry (to avoid complication with history)

share|improve this answer

Your Answer


