How to flatten commits before rebasing off of the main branch. With just one single commit, you avoid the stop-start nature of fixing merge conflicts with multiple commits. To flatten the commits before the rebase, you can slightly modify the original command: git rebase -i HEAD~[NUMBER_OF_COMMITS]

1m read timeFrom davidwalsh.name
Post cover image

Sort: