git-extras
git-extras copied to clipboard
git-delete-merged-branches are removing branch without remote
E.g: git feature removing-branch-without-remote git checkout master git delete-merged-branches
Result: feature/removing-branch-without-remote just gone :/
//cc @spacewander had you seen this before?
This sounds like expected behaviour to me. If the branchremoving-branch-without-remote
doesn't have any new/unmerged commits, then it is considered "merged".
It doesn't remove branches without remote. It just removes branches whose tips are reachable from HEAD.
Let's look at the example:
C --- E merged
/ \
A --- B --- D --- F current
As @nicolaiskogheim says, once you create a branch removing-branch-without-remote
without new commits:
C --- E merged
/ \
A --- B --- D --- F current/removing-branch-without-remote
The removing-branch-without-remote
is still reachable from commit F.
In some cases, the merged
branch's tip will be the same as current branch's.
One of them is fast-forward merge
.
Consider this example:
C --- E merged
/ \
A --- B --- - --- E current(fast-forward)
If we define a commit can't reach itself, the fast-forward merged branch will be omitted.