Wednesday, October 16, 2019

Git, how to do a clean squash easy way


Simple as following

> git checkout bugfix/bugone
//do 6 commits and push it upstream
//now you want to squash all 6 in to one
//do the sqashing by number of commits
> git reset --soft HEAD~6 &&
> git commit
//force push the newly created single commit to upstream
//make sure you are the only user of this branch
> git push origin bugfix/bugone --force

Share Article : Git, how to do a clean squash easy way
Share/Save/Bookmark