Skip to content

Instantly share code, notes, and snippets.

@prakashrd
Last active May 18, 2018 07:39
Show Gist options
  • Save prakashrd/4c69bdd1efb9a6a2c8bb2822ed145ebd to your computer and use it in GitHub Desktop.
Save prakashrd/4c69bdd1efb9a6a2c8bb2822ed145ebd to your computer and use it in GitHub Desktop.
Git : Squash commits after push
git checkout my_branch
git reset --soft HEAD~4
git commit
git push --force origin my_branch
## The above resets four commits you have pushed. Though it can be done any branch but doing it on feature branch is a
## good practise
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment