I am working on a project that has two branches: master
and feature
The feature
branch was created some time ago and has numerous
I do not care about the history of the commits.
If you really don't care about history, a git merge --squash
is going to let you resolve all your conflicts at once and produce a single commit with all the changes.
To essentially do that --squash
in-place, you could do something like this:
git branch -m feature feature-old
git checkout master -b feature
git merge --squash feature-old
After you resolve all conflicts (once), you will create a single commit on feature
that has master
as a parent.
That being said, I'm a fan of keeping history. Definitely try rerere
first. You might also try an in-place rebase --interactive
(e.g. git rebase -i $(git merge-base HEAD master)
) to squash the fixup-type commits without completely eliminating all the discrete commits.