10

I have been developing a branch happily and each day rebasing each day from the master with:

git rebase master

Today when I did a rebase master, I get the following message:

Falling back to patching base and 3-way merge...

The rebase took me through a very lengthy process of merging the same set of files over and over again. It stated "Patch failed at 001" and continued up until 044.

After I had finished the rebase and pushed the branch to the remote, I entered the rebase command again WITHOUT doing any modifications to the code:

git rebase master

It then took me through the exact same rebase again. I am totally lost as to what is going on. I just want to apply bug fixes from the master to this branch without going through this process each time.

Can anyone help me out with what is going on. I don't want to have to go through this each time I rebase from the master.

meager
  • 209,754
  • 38
  • 307
  • 315
dagda1
  • 21,477
  • 48
  • 188
  • 367
  • Maybe you want to take a look here: http://stackoverflow.com/questions/4215726/from-git-to-svn-failed-to-merge-in-the-changes – J. Bruni May 27 '11 at 13:58
  • It is possible that someone did some of the things that should NOT be done, at the master branch you are rebasing from. These things are commands that change past history, like "amend" and others... – J. Bruni May 27 '11 at 14:00
  • no changes to the history in this way – dagda1 May 27 '11 at 14:01
  • More info here: http://stackoverflow.com/questions/4033009/git-rebase-conflicts-keep-blocking-progress Maybe a `git rebase --skip` case? – J. Bruni May 27 '11 at 14:06
  • Or a `git rebase --continue`? http://jeffkreeftmeijer.com/2010/the-magical-and-not-harmful-rebase/ – J. Bruni May 27 '11 at 14:07

1 Answers1

4

Using git rebase to continually rebase onto another branch goes to the way Git is generally expected to work. What you should probably be doing is merging master into your own development branch every so often. This will keep your development branch up to date with changes from master and will keep your own development commits out of the master branch.

If you don't want to have a bunch of merges in from master in your development branch, use git rerere's functionality and do:

git merge master
git reset HEAD~

With git rerere enabled, it will record your merge resolutions if there are any conflicts so that you won't have huge conflicts later.

Marcus Griep
  • 7,288
  • 1
  • 20
  • 23
  • I think merging onto the development branch and rebasing onto the master makes a lot of sense. – dagda1 May 27 '11 at 14:15
  • Thought `rerere` was typo, but glad to find it's a command that can be very useful in my case. – Jayesh Feb 11 '13 at 17:11
  • Does this command save merge resolutions only locally or they may be pushed to the server, so other people can use them for their merges? – dk14 Oct 21 '14 at 22:49