0

My question is similar to this one: With "git svn", Can I Ignore Specific Git Commits While Fetching?

I'm using git-svn with a standard svn repo:

trunk
branches
tags

Then a co-worker accidentally branched the root into a project branch, so it looked like this:

trunk
branches
   badProject
      trunk
      branches
      tags
tags

If the branch had died, I'd probably be able to use --ignore-paths to ignore it

However, having realized the error, the developer committed changes to the bad project in /branches/badProjects/trunk and later merged this into /trunk

git-svn fetch dies. How can I pretend this bad branch didn't happen?

Is there a way to convince git-svn that there wasn't a branch and treat the merge into trunk as if it was a normal checkin instead of a merged branch?

Community
  • 1
  • 1
Adam Tegen
  • 25,378
  • 33
  • 125
  • 153

1 Answers1

0

Assuming we had initial branch creation as 666, a checkin at 800, and a merge at 1000 I managed to get it to work as follow:

git svn reset -r665
git svn fetch -rBASE:665
git svn fetch -r667:799
git svn fetch -r801:999
git svn fetch -r1000 --no-follow-parent
git svn fetch -r1001:HEAD

Line 1 and 2 ensure that I back out to before the bad commit.

Line 3 and 4 pull in changes for the revisions that weren't the bad branch

Line 5 with --no-follow-parent gets the merge without acknowledging it was actually a merge

Line 6 gets the rest.

Adam Tegen
  • 25,378
  • 33
  • 125
  • 153