« Back to Index

git merge –squash brings in your changes but doesn’t create a commit. Instead it will stage your changes so you can create a fresh commit for it (avoiding ugly merge commits showing in GitHub when using a standard git merge)

View original Gist on GitHub

git-merge-squash.sh

git merge --squash <branch|commit> # only works with single commits

# When specifying a commit hash, this is still different from something like
# `git cherry-pick` because that would create a commit where as --squash simply
# copies the changes into your staging area