{"thread":{"id":"21609","subject":"Resolving a merge conflict with git-svn","startedAt":"2009-11-14T00:30:57Z","lastAt":"2009-11-14T00:58:10Z","messageCount":2,"participants":["Jens Kubieziel","Daniele Segato"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"127527","messageId":"76ee5f990911131630k41a91f70n5e717befb7693463@mail.gmail.com","threadId":"21609","inReplyTo":null,"subject":"Resolving a merge conflict with git-svn","fromName":"Jens Kubieziel","fromEmail":"kubieziel@googlemail.com","sentAt":"2009-11-14T00:30:57Z","receivedAt":"2009-11-14T00:30:57Z","isPatch":false,"sender":{"key":"kubieziel@googlemail.com","avatar":null},"body":"Hi,\n\nI recently came across a big conflict. Someone used Subversion and\nmade a complete wrong commit. I did a 'git svn rebase' at some point\nand ran into the conflict. My goal at this point was to remove the\nwrong commit, but I found no way how to do it (git-revert needs a\nclean tree; git stash brought [fatal: git-write-tree: error building\ntrees,Cannot save the current state]). What way would suggest to\nremove that wrong made commit and continue with the rebase?\n\nThanks for any hints.\n"},{"id":"127528","messageId":"1258160291.6082.42.camel@localhost","threadId":"21609","inReplyTo":"76ee5f990911131630k41a91f70n5e717befb7693463@mail.gmail.com","subject":"Re: Resolving a merge conflict with git-svn","fromName":"Daniele Segato","fromEmail":"daniele.bilug@gmail.com","sentAt":"2009-11-14T00:58:10Z","receivedAt":"2009-11-14T00:58:10Z","isPatch":false,"sender":{"key":"daniele.bilug@gmail.com","avatar":null},"body":"Il giorno sab, 14/11/2009 alle 01.30 +0100, Jens Kubieziel ha scritto:\n> Hi,\n> \n> I recently came across a big conflict. Someone used Subversion and\n> made a complete wrong commit. I did a 'git svn rebase' at some point\n> and ran into the conflict. My goal at this point was to remove the\n> wrong commit, but I found no way how to do it (git-revert needs a\n> clean tree; git stash brought [fatal: git-write-tree: error building\n> trees,Cannot save the current state]). What way would suggest to\n> remove that wrong made commit and continue with the rebase?\n\nI don't know if this could help but I tell you what I would do.\n\nI would abort the conflicting rebase\n\n\"backing up\" my branch by:\n\ngit checkout mybranch\ngit checkout -b mybranchBackup\n\nthen I would do a git reset --hard <last-committed-svn-commit>\n\nat this point a:\ngit svn rebase\n\nshouldn't give conflict since it should be a fast forward.\n\nThen you should have two branch:\n\nmybranch: which is SVN-up-to-date but has no one of your modification\nmybranchBackup: which has an old SVN before the wrong commit but with\nall your modifications...\n\nat this point you can use git revert to revert the wrong commit into\nyour \"mybranch\".\n\nand then you can cherry-pick all your modification from mybranchBackup\n\nmay be you could also been able to rebase upon it....\nbut I would do an interactive rebase to \"see\" what's going to do and\nbeing able to control it\n\nlike:\n\ngit checkout mybranchBackup\ngit rebase -i mybranch\n"}]}