Skip to content

Instantly share code, notes, and snippets.



Created May 19, 2020
What would you like to do?
Fish function to pull latest code from remote and remove merged local branches
function gp
echo "Pulling latest code..."
git pull
git pull --tags -f
echo "\nDeleting local branches that were removed in remote..."
git fetch -p
git branch -vv | awk '/: gone]/{print $1}' | xargs git branch -D
echo "\nRemaining local branches:"
git branch -vv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment