Codebase list rust-stfu8 / 66caf4b
dev: sync-pending-branches: delete remote merged branches too Ximin Luo 2 years ago
1 changed file(s) with 6 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
77
88 git fetch origin --prune
99 PREVBRANCH="$(git rev-parse --abbrev-ref HEAD)"
10
11 # delete merged
1012 git branch --merged | tr -d ' ' | grep ^pending- | xargs -trn1 git branch -d
13 merged=( $(git branch --list -r 'origin/pending-*' --format='%(refname:lstrip=3)' --merged) )
14 git push origin "${merged[@]/#/:}"
15
16 # sync local branches
1117 git branch --list -r 'origin/pending-*' --format='%(refname:lstrip=3)' | while read b; do
1218 if [ -z "$(git_hash "$b")" ]; then
1319 git checkout "$b"