Created
April 1, 2025 09:42
-
-
Save bnguyensn/05cecfcd4f1b50e9e51378de7b61e4ad to your computer and use it in GitHub Desktop.
This file contains hidden or 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
git fetch -p | |
for branch in $(git branch --format='%(refname:short)' | grep -v 'develop'); do | |
remote_branch=$(git for-each-ref --format='%(upstream:short)' refs/heads/$branch) | |
if [ -n "$remote_branch" ] && ! git show-ref --quiet "refs/remotes/$remote_branch"; then | |
git branch -d "$branch" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment