mycli gbc,gitc: git branch clean gitの掃除
デフォルトブランチへ移動
fetch(リモートで消したブランチはローカルでも消す)
master,main,develop,デフォルトブランチを除くブランチ群を削除トライ
code:shell
git switch $(gh repo view --json defaultBranchRef --jq ".defaultBranchRef.name") && git fetch --all --prune && git pull && (git branch | grep -v $(git branch --show-current) | grep -v "develop" | grep -v "main" | grep -v "master" | xargs -I{} git branch -d {})
code:.zshrc
alias gitc='git switch $(gh repo view --json defaultBranchRef --jq ".defaultBranchRef.name") && git fetch --all --prune && git pull && (git branch | grep -v $(git branch --show-current) | grep -v "develop" | grep -v "main" | grep -v "master" | xargs -I{} git branch -d {})'