Git squash all commits in branch without conflicting

If you don’t need the commit information, then you could just do a soft reset. Then files remain as they were and when you commit, this commit will be on top of the commit you did reset to.

To find the commit to reset to:

git merge-base HEAD BRANCH_YOU_BRANCHED_FROM

Then

git reset --soft COMMIT_HASH

Then re-craft the commit, perhaps:

git commit -am 'This is the new re-created one commit'

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)