threads / discuss / 22096

cannot remove remote branch name

Subject: cannot remove remote branch name

## tl;dr

3 messages between Jan 5, 2010 and Jan 5, 2010.

replies: 2people: 3as markdown or json

SungHyun Nam· Jan 5, 2010, 01:57 UTC · lore
Hello,

How I can remove remote branch name if it already removed in remote side?

$ git branch -a
* master
   remotes/origin/HEAD -> origin/master
   remotes/origin/master
   remotes/origin/test
$ git branch -D -r test
error: remote branch 'test' not found.
$ git branch -D -r remotes/origin/test
error: remote branch 'remotes/origin/test' not found.
$ git branch -D remotes/origin/test
error: branch 'remotes/origin/test' not found.
The 'remotes/origin/test' was removed in remote side.

Thanks, namsh

Erik Faye-Lund· Jan 5, 2010, 01:59 UTC · re: SungHyun Nam · lore

Re: cannot remove remote branch name

On Tue, Jan 5, 2010 at 2:57 AM, SungHyun Nam <goweol@gmail.com> wrote:
Show 19 quoted lines
> Hello,
>
> How I can remove remote branch name if it already removed
> in remote side?
>
> $ git branch -a
> * master
>  remotes/origin/HEAD -> origin/master
>  remotes/origin/master
>  remotes/origin/test
> $ git branch -D -r test
> error: remote branch 'test' not found.
> $ git branch -D -r remotes/origin/test
> error: remote branch 'remotes/origin/test' not found.
> $ git branch -D remotes/origin/test
> error: branch 'remotes/origin/test' not found.
>
> The 'remotes/origin/test' was removed in remote side.
>
$ git remote prune origin
-- 
Erik "kusma" Faye-Lund
Junio C Hamano· Jan 5, 2010, 02:18 UTC · re: SungHyun Nam · lore

Re: cannot remove remote branch name

SungHyun Nam <goweol@gmail.com> writes:
Show 14 quoted lines
> How I can remove remote branch name if it already removed
> in remote side?
>
> $ git branch -a
> * master
>   remotes/origin/HEAD -> origin/master
>   remotes/origin/master
>   remotes/origin/test
> $ git branch -D -r test
> error: remote branch 'test' not found.
> $ git branch -D -r remotes/origin/test
> error: remote branch 'remotes/origin/test' not found.
> $ git branch -D remotes/origin/test
> error: branch 'remotes/origin/test' not found.
Hmm, you tried "test" and then "remotes/origin/test"?
The way I would have guessed what to give the command is:
 1. "branch -D -r test" wouldn't make sense, as git wouldn't know 'test'
    of which remote I am trying to remove;
 2. "-r" already tells git that I am talking about remote, so perhaps
    "branch -D -r origin/test" would work without me saying "remotes/".

"git branch -[dD]" doesn't go over the network, so it doesn't matter if it is already removed on the remote side or not.

← back to recent threads