# delete remote branches

2 messages from 2009-12-08 to 2009-12-08. Participants: Patrick Grimard, Andreas Schwab.
Thread: https://gitlist.dev/t/21910

## Patrick Grimard, 2009-12-08 20:35

Subject: delete remote branches
Message-ID: <9cdb17250912081235m2b061ca5x70fe42749b49670f@mail.gmail.com>
URL: https://gitlist.dev/e/9cdb17250912081235m2b061ca5x70fe42749b49670f%40mail.gmail.com

```
I'm experimenting with Git, just trying to get a feel for it.  I
created a bare git repo on a server and pushed a local git repo (let's
call it DIR1) from my PC to the server.  Then from another directory
on my local PC (let's call it DIR2), I cloned the repo on the server
and checked out a new branch named testBranch.  Did some playing with
branches to see how they worked, like pushing the branch to the server
from DIR2 and fetching it from DIR1, merging it into master and then
pushing master back to the server.  Now from DIR2, I fetched master
from the server, merged in the changes and deleted the remote branch
called testBranch using the command "git push origin :testBranch"
which seemed to work fine since the command "git branch -r" no longer
lists the remote branch.  However from DIR1 if I do "git branch -r" I
still see the remote branch and can't seem to delete it using the
above method.  Any idea why this is happening?

Thanks in advance.

Patrick

```

## Andreas Schwab, 2009-12-08 22:06

Subject: Re: delete remote branches
Message-ID: <m27hsxazoi.fsf@igel.home>
URL: https://gitlist.dev/e/m27hsxazoi.fsf%40igel.home
In-Reply-To: <9cdb17250912081235m2b061ca5x70fe42749b49670f@mail.gmail.com>

```
Patrick Grimard <pgrimard@gmail.com> writes:

> However from DIR1 if I do "git branch -r" I still see the remote
> branch and can't seem to delete it using the above method.

Try "git remote prune origin".

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

```
