Skip to content

Instantly share code, notes, and snippets.

@mifas
Created November 28, 2019 01:19
Show Gist options
  • Save mifas/15dc4cc9412cef36e1714a41a12d8184 to your computer and use it in GitHub Desktop.
Save mifas/15dc4cc9412cef36e1714a41a12d8184 to your computer and use it in GitHub Desktop.
git branch --squash with simplified commit logs
function git_squash_branch() {
b=$1
git merge --squash "$b"
echo ""
echo ""
git log --reverse --format='%h %s ► %an <%ae>' .."$b"
#git commit -m "$(git log --reverse --format='%h %s ► %an <%ae>' .."$b")"
}
alias gsb="git_squash_branch"
# ---- usage ----
# git checkout master
# gsb feature-branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment