Re: Resolving a merge conflict with git-svn

Previous thread: GNU patch: new 2.6 release by Andreas Gruenbacher on Friday, November 13, 2009 - 5:09 pm. (6 messages)

Next thread: [PATCH] git-add.txt: fix formatting of --patch section by Stephen Boyd on Friday, November 13, 2009 - 6:45 pm. (1 message)
From: Jens Kubieziel
Date: Friday, November 13, 2009 - 5:30 pm

Hi,

I recently came across a big conflict. Someone used Subversion and
made a complete wrong commit. I did a 'git svn rebase' at some point
and ran into the conflict. My goal at this point was to remove the
wrong commit, but I found no way how to do it (git-revert needs a
clean tree; git stash brought [fatal: git-write-tree: error building
trees,Cannot save the current state]). What way would suggest to
remove that wrong made commit and continue with the rebase?

Thanks for any hints.
--

From: Daniele Segato
Date: Friday, November 13, 2009 - 5:58 pm

I don't know if this could help but I tell you what I would do.

I would abort the conflicting rebase

"backing up" my branch by:

git checkout mybranch
git checkout -b mybranchBackup

then I would do a git reset --hard <last-committed-svn-commit>

at this point a:
git svn rebase

shouldn't give conflict since it should be a fast forward.

Then you should have two branch:

mybranch: which is SVN-up-to-date but has no one of your modification
mybranchBackup: which has an old SVN before the wrong commit but with
all your modifications...

at this point you can use git revert to revert the wrong commit into
your "mybranch".

and then you can cherry-pick all your modification from mybranchBackup

may be you could also been able to rebase upon it....
but I would do an interactive rebase to "see" what's going to do and
being able to control it

like:

git checkout mybranchBackup
git rebase -i mybranch



--

Previous thread: GNU patch: new 2.6 release by Andreas Gruenbacher on Friday, November 13, 2009 - 5:09 pm. (6 messages)

Next thread: [PATCH] git-add.txt: fix formatting of --patch section by Stephen Boyd on Friday, November 13, 2009 - 6:45 pm. (1 message)