Git branch deletion not based on HEAD branch anymore

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I have noticed that in the "latest" versions of git, `git branch -d
branch` instead of refusing to delete a branch that hasn't been merged
to HEAD, it now throws a warning and deleting the local branch if it's
present in a remote.

Example:
```
> git branch -d command-runner
warning: deleting branch 'command-runner' that has been merged to
         'refs/remotes/origin/command-runner', but not yet merged to HEAD.
Deleted branch command-runner (was 1716ed5).
```

After diving in git blame for a while I have realized that "lately"
refers to a commit done in 2009.

Because the change is over 7 years old, I will explain what is my use case.

The workflow I follow since I started with git is to start an exact
replica of my working environment in a personal fork. Anything deleted
locally is deleted remotely and viceversa. This allows me to move
between work and home smoothly. I also use the default `git config
push.default matching`

My typical day starts and ends pulling master from the central repo,
and `git branch -d`-ing  all the branches I have in local. git would
delete the ones that have been merged, and leave alone the ones that
have been not been merged. Then I rebase all my branches and push the
new master and rebased branches. Because all my local branches track
my personal repo, all of them get deleted if I execute my scripts.

I understand it's not possible / convenient anymore to go back, but
would it be possible to have an option such as `--merged` to support
the old usecase?

-- 
Javier Domingo Cansino



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]