Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save andreyserdjuk/6c6ff52db75d3da0787fa8e68a0478fa to your computer and use it in GitHub Desktop.
Save andreyserdjuk/6c6ff52db75d3da0787fa8e68a0478fa to your computer and use it in GitHub Desktop.
Git commands
https://git-scm.com/docs/git-remote
git remote prune --dry-run origin
git remote update origin --prune
# get all removed branches on server side
git branch -vv | grep -Po '\s(feature\S+)(?=.*\s+gone\])'
# so you can remove all "gone" branches:
git branch -D $(b -vv | grep -Po '\s(feature\S+)(?=.*\s+gone\])')
# fix fetch remote branches
git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment