mircobabini
7/9/2013 - 10:26 AM

git commodities up, down, reset

git commodities up, down, reset

#!/bin/bash
if [ "$#" -eq 0 ]; then
	echo "usage:      ./git up|down|reset";
else
	if [ "$1" = "up" ]; then
		read -p "Commit description: " desc
		git add . && \
		git add -u && \
		git commit -m "$desc" && \
		git push origin master
	elif [ "$1" = "down" ]; then
		git pull origin master
	elif [ "$1" = "reset" ]; then
		git fetch --all
		git reset --hard origin/master
	else
		echo "usage:      ./git up|down|reset";
	fi
fi