Fabien Bouleau Fabien Bouleau - 29 days ago 9
Git Question

In TortoiseGit, what is the equivalent of git branch -d (without the --force option)?

How to delete a Git branch with TortoiseGit has been partially answered here. However it doesn't cover the

--force
option. How can I use TortoiseGit's delete branch feature without the
--force
option?

Answer Source

TortoiseGit uses git.exe branch -D to delete branch while not using libgit2 to delete refs. And, there is no use case for -d option. See:

enter image description here

(From TortoiseGit 2.5.2 source code)

However, TortoiseGit usually asks user if they want to delete the branch. See:

enter image description here

Useful information: (from comment by @Fabien Bouleau)

Git with "-d" checks that the branch has been merged before deleting.
TortoiseGit shows an agnostic prompt, a confirmation to prevent a click by mistake.
But it does not preserve your work.

(If you deleted an unmerged branch, you can get it back by using Reflog dialog. Actually, get those commits back. :P )

Yes. TortoiseGit should do something for deleting unmerged branch.