Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] Remove deleted tracking branches #1220

Open
jm4R opened this issue Apr 4, 2022 · 0 comments
Open

[Feature request] Remove deleted tracking branches #1220

jm4R opened this issue Apr 4, 2022 · 0 comments

Comments

@jm4R
Copy link
Contributor

jm4R commented Apr 4, 2022

There is a highly wanted feature, which is nit built-in into git itself:
https://stackoverflow.com/questions/7726949/remove-tracking-branches-no-longer-on-remote

This answer in stackoverflow seems legit:

git fetch -p && for branch in $(git for-each-ref --format '%(refname) %(upstream:track)' refs/heads | awk '$2 == "[gone]" {sub("refs/heads/", "", $1); print $1}'); do git branch -D $branch; done

(The accepted answer does something different - it deletes merged branches, not the ones with are tracking but missing on remote).

Can we have such feature built-in to cola?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant