Re: Amending merge commits?
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Jul 25, 2014, 22:19 UTC
- Message-ID
- <20140725221911.GL12427@google.com>
- In-Reply-To
- <22F01493C523F940B4B5E53BB6D0F5352275F207@G5W2738.americas.hpqcorp.net>
Besen, David wrote:
> I think one of my coworkers has stumbled on a git bug -- if you > amend a merge commit, and then pull, your amends are lost.
This is how pull --rebase works. It turns your single-parent commits into a sequence of patches on top of upstream and completely ignores your merge commits.
There is a --rebase=preserve option that makes a halfhearted attempt to preserve your merges --- perhaps that would help? The git-rebase(1) documentation has more details.
In an ideal world, I think pull --rebase would do the following:
1. Do the same thing it does today
2. Behind the scenes, *also* try a 'pull --merge' but don't save
the result.
3. Compare the results. If they differ, show a diff and explain
to the user what happened.I may be the only one that wants that, though.
Hope that helps, Jonathan