Skip to content

Instantly share code, notes, and snippets.

@stepankuzmin
Last active April 27, 2021 09:49
Show Gist options
  • Save stepankuzmin/4eb603b6cf85da4446f7fa91a08d1816 to your computer and use it in GitHub Desktop.
Save stepankuzmin/4eb603b6cf85da4446f7fa91a08d1816 to your computer and use it in GitHub Desktop.
Git alias for squashing last N commits into it's parents
git config --global alias.fixup "\!f(){ git reset --soft HEAD~${1} && git commit --amend -C HEAD; };f"
git fixup 1 # squashes last commit into it's parent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment