Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Option to delete only not merged branches #785

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
ltetak wants to merge 1 commit into sourcegit-scm:master from ltetak:delete_not_merged

Conversation

Copy link

@ltetak ltetak commented Dec 4, 2024

As a user, I would like to ensure I don't delete not merged branches accidentally. This is also helpful when cleaning up local branches.
On additional change would be helpful here to add --prune in the fetch option. I can add that separately.

Copy link
Collaborator

  • The confirmation panel to delete a branch itself is a reminder of this operation, the user needs to check and confirm, then click OK to start this operation.
  • You can toggle Enable --prune on fetch from repository setting dialog.

Copy link
Author

ltetak commented Dec 4, 2024

I found the Enable --prune on fetch, thanks!

I don't fully agree that the confirmation panel is enough. How should I be sure that there are no pending changes? I would have to see if I pushed everything manually (one branch at a time). The -D option can cause changes to be lost, while the -d should be pretty safe and almost always do the job.

The problem I am trying to solve is cleaning up local folders that were merged. No git client has a great solution for this. Some at least notify you about the state of the branch (1. not-tracked 2. tracked 3. tracked but the origin branch has been deleted). This allows you to delete category 3 without risking deleting category 1.

Copy link
Collaborator

I would like to add the track status to this panel if the target branch is local branch and has valid upstream and their HEAD is different. For example:

image

ltetak reacted with heart emoji

Copy link
Author

ltetak commented Dec 4, 2024

I would like to add the track status to this panel if the target branch is local branch and has valid upstream and their HEAD is different. For example:

That looks great. Then it should also go into the multi-delete dialog and the Local Branches list.
image

Copy link
Collaborator

I'll close this issue since it is not necessary.

Copy link
Author

ltetak commented Dec 17, 2024

@love-linger I don't mind. I find it surprising that all git clients have git branch -d as default since it's the safer one. I think you should reconsider at least that.

Copy link
Collaborator

I do not think so.

Fork, GitKraken and JetBrains IDEs use -D or --delete --force to delete a local branch. Even the JetBrains IDE doesn't require the user to confirm the operation again.

ltetak reacted with thumbs up emoji

Copy link
Author

ltetak commented Dec 17, 2024

I am, obviously, not an expert so I won't argue. SourceTree (which resembles SourceGit the most) has -d as the default.
JetBrains Rider has a post notification with a rollback feature
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /