Skip to content

Instantly share code, notes, and snippets.

@ataliba
Created December 4, 2012 00:31
Show Gist options
  • Save ataliba/4199368 to your computer and use it in GitHub Desktop.
Save ataliba/4199368 to your computer and use it in GitHub Desktop.
gpuf
gpuf () {
# git pull -f $1
remote=${1:?"need remote to force pull from"}
current_branch=$(git symbolic-ref -q HEAD)
current_branch=${current_branch##refs/heads/}
current_branch=${current_branch:-HEAD}
if [ $current_branch = 'HEAD' ] ; then
echo
echo "On a detached head. Exiting..."
exit 1
fi
git fetch $remote $current_branch
git reset --hard FETCH_HEAD
git clean -df
}
@ataliba
Copy link
Author

ataliba commented Dec 4, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment