Search code examples
svngit

Never-ending GIT story - what am I doing wrong here?


I'd like to get a local GIT repository in sync with both a remote GIT and an SVN repository.

The steps I'm executing are the following:

> git push
Everything up-to-date

> git pull
Already up-to-date.

Alright, my remote GIT repos seems to be fine so far.

> git svn rebase
First, rewinding head to replay your work on top of it...
Applying: Fixing some javadoc problems.
Using index info to reconstruct a base tree...
<stdin>:13: trailing whitespace.
\t
<stdin>:21: trailing whitespace.
\t\t\t\t<configuration>
<stdin>:22: trailing whitespace.
\t\t\t\t\t<links>
<stdin>:23: trailing whitespace.
\t\t\t\t\t\t<link>http://java.sun.com/javase/6/docs/api/</link>
<stdin>:24: trailing whitespace.
\t\t\t\t\t</links>
warning: squelched 1 whitespace error
warning: 6 lines add whitespace errors.
Falling back to patching base and 3-way merge...
Auto-merging lilith-parent/pom.xml
I replaced tabs with \t for clarity.

That's a merge I've already done, previously...
I now have a new local version.

> git svn dcommit
[commits the new version to SVN... again...]

Now master and trunk are both at the head of my local repository.

> git push
To ssh://[email protected]/gitroot/lilith/lilith
! [rejected] master -> master (non-fast forward)
error: failed to push some refs to 'ssh://[email protected]/gitroot/lilith/lilith'

This means, AFAIK, that I have to execute a pull first. Soooo....

> git pull
Already uptodate!
Merge made by recursive.

which puts me back to the very beginning ... :( Rinse and repeat.

I have the feeling that I'm missing some quite important point here. Can anyone explain this to me?


Solution

  • One branch can not be tracked both with svn via git-svn and with git via push/pull. You should make these two branches separate and do git rebase on synced branches locally, when you want to transfer commits between these branches