Skip to content

Instantly share code, notes, and snippets.

@geekbass
Last active December 28, 2018 19:15
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save geekbass/a3c09ae8e5907b3c27d1168a46f745cb to your computer and use it in GitHub Desktop.
Squash Commits for Feature Branch

Update Branch with Master if been updated since

git pull origin master

Check commit history for $N number of Commits

git reset --soft HEAD~$N
git commit -m "squashing commits"

If preivous push(s) to repo, force push (+)

git push origin +name-of-feature-branch

else, if no previous pushes then just push without force

git push origin name-of-feature-branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment