I'm frequently squashing all the commits on a feature branch before committing to master. Here's what I do currently:
git checkout master
git merge --squash {branch}
git commit -m "{feature_summary}"
Is there an git alias I can use to do this? The aliases I'm familiar with (e.g. stashes = stash list
or uncommit = reset --soft HEAD~1
) don't store variables, and in this case the second command needs to know which branch we came from at the beginning of the commands, so I imagine has to store this information.
Ideally I'd like a git alias such as git squash
which does all those commands. I'm fine with either expecting a string as the commit message, or opening an editor to enter the message.