Skip to content

Instantly share code, notes, and snippets.

@kerbyfc
Last active October 20, 2017 15:21
Show Gist options
  • Save kerbyfc/ec3178b75803e1adf5cba77ff92d2c48 to your computer and use it in GitHub Desktop.
Save kerbyfc/ec3178b75803e1adf5cba77ff92d2c48 to your computer and use it in GitHub Desktop.
function gre () {
git fetch
if [ "$1" != "" ]
then
echo "Reset to origin/\e[34m$1\e[0m"
git reset --hard origin/$1
else
echo "Reset to origin/\e[34m$(git rev-parse --abbrev-ref HEAD)\e[0m"
git reset --hard origin/$(git rev-parse --abbrev-ref HEAD)
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment