Naimdjon TakhirovFollowJul 13, 2021·1 min readGit cleanup: delete local branches deleted on a remotePrune deleted remotes:git fetch --prune2. Identifying “gone” branches and delete them:git for-each-ref --format '%(refname:short) %(upstream:track)' | awk '$2 == "[gone]" {print $1}' | xargs -r git branch -D