Forked from Alexey-Architect/gist:e900ddacf09f2ec5f4dd205ab5df33d1
Last active
October 20, 2023 14:36
-
-
Save andreyserdjuk/6c6ff52db75d3da0787fa8e68a0478fa to your computer and use it in GitHub Desktop.
Git commands
This file contains 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
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