Skip to content

Instantly share code, notes, and snippets.

@sharat
Last active December 15, 2016 12:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sharat/4bf2a5f3f34d326436383c3d6793e90a to your computer and use it in GitHub Desktop.
Save sharat/4bf2a5f3f34d326436383c3d6793e90a to your computer and use it in GitHub Desktop.
When you local repository fails to remove invalid remote referneces
# The symptoms. When you do this, you keep on getting new and deleted branches all the time
git remote update
git pull
# Symptom 2 (for obvious reasons).
git branch -a --merged # Check the merged branches
git push origin --delete [branch name] # this complains remote doesn't exist
# The remedy
git remote prune origin # Remove all the stale references from remote
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment