#!/bin/bash mv $GVM_ROOT/git.bak $GVM_ROOT/.git if [ $? -ne 0 ]; then echo "Couldn't find git info" exit 1 fi cd $GVM_ROOT && git checkout -f if [ $? -ne 0 ]; then echo "Failed to clean install" exit 1 fi if [[ -n $1 ]]; then cd $GVM_ROOT && git checkout $1 -f if [ $? -ne 0 ]; then echo "Failed to checkout $1 branch" exit 1 fi fi cd $GVM_ROOT && git pull if [ $? -ne 0 ]; then echo "Failed to update" exit 1 fi mv $GVM_ROOT/.git $GVM_ROOT/git.bak if [ $? -ne 0 ]; then echo "Couldn't backup git info" exit 1 fi