Sometimes you want to do the equivalent of a Github Squash-and-Merge without the merge.
I originally had the stuff below the line, but it turns out you can just do this with git merge --squash
, see https://gist.github.com/aortbals/2aeb557bf127dd7ae88ea63da93479fc.
git checkout <my branch>
git checkout -b <my branch>-backup
git checkout <base branch>
git pull
# Make sure you have created -backup !!!