Skip to content

Instantly share code, notes, and snippets.

@turker0
Last active November 19, 2021 08:18
Show Gist options
  • Save turker0/81a6b9d8ac4915799a082cb3ac0724c8 to your computer and use it in GitHub Desktop.
Save turker0/81a6b9d8ac4915799a082cb3ac0724c8 to your computer and use it in GitHub Desktop.
Update Master Branch & Delete Closed Local Branches
git checkout master
git remote update origin -p
git pull origin master
git fetch -p && for branch in $(git branch -vv | grep ': gone]' | awk '{print $1}'); do git branch -D $branch; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment