killing remote branches

34 views
Skip to first unread message

Barry Warsaw

unread,
Nov 18, 2016, 12:25:13 PM11/18/16
to ma...@googlegroups.com
Magit is a thing of beauty, but I have one small problem that often frustrates
me. If this is a simple bug, I'm happy to report it but it could also just be
pebkac.

FTR: Emacs 24.5.1 on Ubuntu 16.10, Magit 2.7.0, Git 2.9.3 (also all from the
standard Ubuntu archive).

When I land pull requests from Github or Gitlab, I generally tell it to delete
the source branch through the associated web ui. But then when I go back to
my local clone of the repo, I still have my local tracking branch and the
remote branch. I like to keep things clean, so I remove the tracking branch
with magit-branch-delete from the *magit-refs* pop up. So far so good.

Now I go to the obsolete remote branch and try to do the same, however this
will give me an error because magit *also* tries to push the branch delete to
the remote, but it's already been deleted through the web. So the remote
branch doesn't get deleted and I have to drop back to the shell to run `git
branch -rd origin/foo`.

Is there a way to tell magit not to error out if it can't push the remote
branch deletion, or to not try to push that deletion? I.e. when I know the
remote branch is already gone, it might be nice to hit `C-u k` to say "delete
the remote branch locally but don't push it".

Cheers,
-Barry

Noam Postavsky

unread,
Nov 18, 2016, 12:37:53 PM11/18/16
to Barry Warsaw, Magit Maling list
I think it should be doing this since Sep 26, see
https://github.com/magit/magit/issues/2778

Barry Warsaw

unread,
Nov 18, 2016, 1:08:49 PM11/18/16
to ma...@googlegroups.com
On Nov 18, 2016, at 12:37 PM, Noam Postavsky wrote:

>I think it should be doing this since Sep 26, see
>https://github.com/magit/magit/issues/2778

Great thanks! I'll watch for a release with that fix in it.

Off-list someone also pointed me to the keybindings for `git fetch --prune`
which accomplishes a similar goal.

Cheers,
-Barry

Reply all
Reply to author
Forward
0 new messages