#!/bin/bash gitaddcommit () { gitadd; if [ -n "$1" ]; then git commit -m "$1"; else git commit; fi } gitaddcommit "$@"