4

I am trying to do a git rebase to migrate data to a disconnected SVN clone branch.

Let's say I am trying this with the SoundManager2 repo from Github.

About the first 20 or so of the rebase actions will work fine. After that it will start hitting some conflicts. Most of them resolve automatically, but regardless it makes me stop and continue.

In this case, I don't care what the conflict is. I just want to overwrite any conflicting files with whatever the latest file is. I've tried to get different merge strategies work, but have had no success.

Any ideas or thoughts? Thanks.

jocull
  • 20,008
  • 22
  • 105
  • 149
  • I'm not sure what you're trying to get to happen. Do you want the latest from the branch you're rebasing onto, or the latest non-conflicted version? – Tyler May 10 '11 at 01:59
  • I'm trying to run a large rebase from `master` onto `git-svn`. For whatever reason, running the rebase produces a bunch of merge conflicts even though `git-svn` is a clean slate. I think what I want is the latest from the branch I'm rebasing. I'd like to preserve all the history while doing the rebase if possible. – jocull May 10 '11 at 02:48
  • Also, I will add that I dumped the entire branch into a series of about 500 patch files. Running `git am ../patches/*` causes the same kind of conflicts that I am seeing with the rebase. – jocull May 10 '11 at 02:49
  • It seems to me that the underlying problem in both cases, is that I have commits happening on two branches. So rev 21 on master gets commited, then rev 22 on some-branch gets commit. These conflict, and I have to resolve. This goes on forever... is there any way I can force a strict history with master? I don't really care about the branches in this case. Maybe it would be nice to separate them in the future. – jocull May 10 '11 at 04:54
  • I'm not much of an expert, but you might want to research 'strategies'. Something like `git rebase -X theirs`... – Benjol May 10 '11 at 05:30
  • I didn't notice the `git-svn` tag. Why is svn coming into the picture at all? Maybe if you post a little ASCII-art diagram of the DAG, it will be easier to understand what you're doing... – Tyler May 10 '11 at 07:05

1 Answers1

-1

You will always get this issue. Git can't assume anything when there's a conflict. Sounds like you want your changes to be on top of whatever is published to the svn repo. I would use "rerere" to help you.

Merging is often better when trying to incorporate latest changes often.

Good luck!

Adam Dymitruk
  • 124,556
  • 26
  • 146
  • 141
  • Is there any way to enforce strict history so that Git isn't trying to merge two distinct branches on top of each other before they are ready? – jocull May 10 '11 at 14:57
  • With SVN you have limited options. You will have to "catch up" and then ensure you are bringing in the latest from SVN often so you don't get into the same situation again. Like I said, do a merge and merge that to the svn branch. Push that up. Then keep things up to date. – Adam Dymitruk May 10 '11 at 21:50