Skip to content

Instantly share code, notes, and snippets.

@tertek
Last active February 3, 2023 08:39
Show Gist options
  • Save tertek/ff5f3557ca88bcbd4614cb5b5a55ff8a to your computer and use it in GitHub Desktop.
Save tertek/ff5f3557ca88bcbd4614cb5b5a55ff8a to your computer and use it in GitHub Desktop.
Squash git commits and push to remote

Squash <n-amount-of-last-commits> locally for <branch>

$ git rebase -i origin/<branch>~<n-amount-of-last-commits> <branch>

and then force push to remote <branch>

git push origin +<branch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment