Take the 2-minute tour ×

I would like to know if there any way to push multiple commits from local Git repository to remote SVN repository and do not merge them into one single commit?

I am using SmartGit and let's say I have 5 commits in my local GIT branch, this branch referenced to remote SVN /trunk, when push those commits to SVN I get one big commit in SVN

Thanks in advance for any help

share|improve this question
do you use git svn dcommit –  Heather Aug 12 '12 at 3:48
I am using SmartGit GUI client, will 'git svn dcommit' solve my problem? –  iKiR Aug 12 '12 at 3:53
I don't know how gui client works but git svn command to make it is that, try if that will help you. –  Heather Aug 12 '12 at 7:27
I don't understand the problem. I use SmartGit for SVN, and when I press 'Push' it pushes 1 SVN commit per 1 Git commit... Maybe you have 5 commits in an anonymous Git branch, that is not translated to SVN. In this case you should name a branch for the anonymous branches and push it first. –  Dmitry Pavlenko Aug 12 '12 at 12:19
@iKiR that's exactly the problem: in the main git branch (let's call it trunk) you just have one "merge" commit, the 5 merge source commits can't be pushed as SVN does not support multiple lines of history in one branch. Hence, instead of merging branch X to trunk, Rebase your five commits onto trunk, so you just have a linear history. –  mstrap May 31 '13 at 8:54
show 1 more comment

1 Answer

From your additional comments, it sounds like the problem is your merge. I recommend reading the git merge documentation, particularly the section on "fast-forward merges". It sounds like your client is doing a "no-ff" merge, which combines the commits on branch X into a single merge commit on your main branch. When you push to SVN it's that single merge commit that's being pushed across.

What you want is a fast-forward merge. From the command-line you can ensure you get this by using git merge --ff-only. I'm not familiar with SmartGit, but from the docs it looks like it offers you this option when you request a merge: http://www.syntevo.com/smartgithg/documentation.html?page=commands-branch#merge

share|improve this answer
add comment

Your Answer


