Skip to content
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

git-delete-merged-branches are removing branch without remote #517

Open
kessiler opened this issue Mar 17, 2016 · 3 comments
Open

git-delete-merged-branches are removing branch without remote #517

kessiler opened this issue Mar 17, 2016 · 3 comments

Comments

@kessiler
Copy link

E.g:
git feature removing-branch-without-remote
git checkout master
git delete-merged-branches

Result:
feature/removing-branch-without-remote just gone :/

@hemanth
Copy link
Collaborator

hemanth commented Mar 21, 2016

//cc @spacewander had you seen this before?

@nicolaiskogheim
Copy link
Collaborator

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".

@spacewander
Copy link
Collaborator

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.

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

No branches or pull requests

4 participants