Created
May 19, 2020 17:46
-
-
Save eneko/bbb7e5a131f45a4b82341826a24ba043 to your computer and use it in GitHub Desktop.
Fish function to pull latest code from remote and remove merged local branches
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment