#!/bin/bash

# Usage: merge_commits.sh [num]
# Merges the last num commits together into one (default: num=2)
# Uses commit message of the oldest commit.

num=$1
if [ "X$num" = "X" ] ; then num=2 ; fi
git reset --soft HEAD~$((num-1)) && git commit --amend -C HEAD

