Skip to content

feat: add git-delete-gone-branches#1240

Open
mkindahl wants to merge 1 commit intotj:mainfrom
mkindahl:feat/git-delete-gone-branches
Open

feat: add git-delete-gone-branches#1240
mkindahl wants to merge 1 commit intotj:mainfrom
mkindahl:feat/git-delete-gone-branches

Conversation

@mkindahl
Copy link
Copy Markdown

@mkindahl mkindahl commented Mar 15, 2026

When using GitHub and using the "Delete" button after merging a branch into a upstreams repository, the remote branch is gone but the local branch stays.

This command removes all "gone" branches that are still checked out.

I have tested this on macOs and Linux, but nothing else.

When using GitHub and using the "Delete" button after merging a branch
into a upstreams repository, the remote branch is gone but the local
branch stays.

This command removes all "gone" branches that are still checked out.
@mkindahl mkindahl force-pushed the feat/git-delete-gone-branches branch from 8d9c1f2 to 4559472 Compare March 18, 2026 18:10
@mkindahl mkindahl marked this pull request as ready for review March 18, 2026 18:13
@mkindahl
Copy link
Copy Markdown
Author

I get the following when running check_integrity.sh despite having added a line similar to the one for git-delete-merged-branches.

mats@fury:~/repos/git-extras$ bash check_integrity.sh 
Add description of git-delete-gone-branches in Commands.md

@hyperupcall
Copy link
Copy Markdown
Collaborator

hyperupcall commented Mar 19, 2026

Thank you for your contribution.

One main issue I see, is that if the branch includes the string "gone", it will automatically be removed, even if it's not actually gone from the remote.

Interestingly, we received a similar PR in #1239. I like the general approach that was decided on, but I'm not sure I'll be giving my approval for the pull request, for some unrelated reasons. But I don't want to ask you to change code if I'm not completely sure that PR #1239 isn't going to be merged.

@mkindahl
Copy link
Copy Markdown
Author

Thank you for your contribution.

One main issue I see, is that if the branch includes the string "gone", it will automatically be removed, even if it's not actually gone from the remote.

Interestingly, we received a similar PR in #1239. I like the general approach that was decided on, but I'm not sure I'll be giving my approval for the pull request, for some unrelated reasons. But I don't want to ask you to change code if I'm not completely sure that PR #1239 isn't going to be merged.

The approach in #1239 does indeed look like a more solid approach. It might make sense to wait until it is closed before closing this PR, but feel free to close this PR once you know the situation.

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

Successfully merging this pull request may close these issues.

2 participants