Skip to content

Instantly share code, notes, and snippets.

@ojacques
Last active September 8, 2021 09:30
Show Gist options
  • Save ojacques/7bb1370ac729e4f0007e60e1501becaf to your computer and use it in GitHub Desktop.
Save ojacques/7bb1370ac729e4f0007e60e1501becaf to your computer and use it in GitHub Desktop.
Squash multiple commits in a PR that was already pushed

Find out the SHA for when the branch was initiated:

$ git merge-base feature/248227-create-drop-artifact develop
b373da2f4b24e57a147021df1d3964a46b47edf3

Rebase / squash interactively:

$ git rebase -i b373da2f4b24e57a147021df1d3964a46b47edf3

Force push to the branch (only do that if branch was not shared elsewhere, mostly OK with PRs):

git push origin +feature/248227-create-drop-artifact
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment