gitgit-cherry-pick

How to squash several commits into a single one when merge issues arise


I made changes into various commits in a branch that diverges from upstream. Now I want to squash them all into a single one, based on upstream's current state. But conflicts issues arise, and while it's not a problem to manually fix them, it breaks all the methods I tried to create a proper single commit:

How to create a proper single commit to send to upstream?


Solution

  • I recommend squashing the commits on your local repository first. That way you get one commit that you can then rebase onto the remote branch.