#!/bin/bash

if [ -z "$1" ]
then
    echo "
    Script usage example: ./commit \"commit message\" [branch]
    "
else
    git add .
    git commit -a -m"$1"

    if [ -z "$2" ]
        then
            git push -u origin --all
        else
            git push -u origin "$2"
        fi
fi