#!/bin/sh # Creates a commit from the given files and automatically # squashes it into the last commit on HEAD. set -e if [ "x`git branch -r --contains HEAD`" != x ]; then echo "HEAD commit already pushed?" exit 1 fi git commit --fixup=HEAD "$@" git rebase --autostash --autosquash HEAD~~