Skip to content

Instantly share code, notes, and snippets.

@aya986
Created March 9, 2020 05:33
Show Gist options
  • Save aya986/4f252e1fd6c7c59762fa6d660752410f to your computer and use it in GitHub Desktop.
Save aya986/4f252e1fd6c7c59762fa6d660752410f to your computer and use it in GitHub Desktop.
// delete all origin branch that deleted from origin and stay in your local
git fetch -p
// chekout to main brach to prevent delete it from local
git checkout master
// delete all local branch
git branch | xargs git branch -d
// delete all origin branch that don't deleted from origin and stay in your local
git branch | xargs git branch -D
// now you have master branch in local
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment