Skip to content

Instantly share code, notes, and snippets.

@pyqlsa
Created July 17, 2022 19:42
Show Gist options
  • Save pyqlsa/431cb284558d2d5198f4beb2ab3a0e0e to your computer and use it in GitHub Desktop.
Save pyqlsa/431cb284558d2d5198f4beb2ab3a0e0e to your computer and use it in GitHub Desktop.
git squash commits on feature branch
#!/usr/bin/env bash
git checkout yourBranch
git reset $(git merge-base master $(git branch --show-current))
git add -A
git commit -m "one commit on yourBranch"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment