Skip to content

prune local branches if remote branch got removed #453

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

Closed
extrawurst opened this issue Dec 20, 2020 · 3 comments
Closed

prune local branches if remote branch got removed #453

extrawurst opened this issue Dec 20, 2020 · 3 comments
Labels
enhancement New feature or request pinned

Comments

@extrawurst
Copy link
Collaborator

extrawurst commented Dec 20, 2020

when in the branch list I want to be able to cleanup local tracking branches of remote branches that were removed on the remote

@ffes
Copy link

ffes commented Jan 14, 2021

You are referring to the tracking branches, but what about the "real" local feature branches?

Did you know about the setting fetch.prune=true to automatically prune the tracking branches?

To delete the latter I use this bash script, found somewhere presumably stackoverflow, and run it from time to time manually. It would be great if gitui could clean them as well.

#!/usr/bin/env bash

branches=$(git branch --no-color --merged | grep -v "\*" | grep -v master | grep -v main)
if [ -n "$branches" ]
then
    echo "$branches" | xargs -n 1 git branch -d
fi

@extrawurst
Copy link
Collaborator Author

@ffes actually this is exactly what I had in mind for this ticket. fetch will already do the prune of tracking branches, just like on the regular git cli.

@stale stale bot added the wontfix This will not be worked on label Jun 18, 2021
@stale stale bot closed this as completed Jun 25, 2021
@extrawurst extrawurst added enhancement New feature or request pinned and removed wontfix This will not be worked on labels Oct 11, 2021
@extrawurst extrawurst reopened this Oct 11, 2021
@gitui-org gitui-org deleted a comment from stale bot Oct 11, 2021
@extrawurst
Copy link
Collaborator Author

closing in favour of #998

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pinned
Projects
None yet
Development

No branches or pull requests

2 participants