git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Sixt <j.sixt@viscovery.net>
To: Yakup Akbay <yakbay@ubicom.com>
Cc: git@vger.kernel.org
Subject: Re: How can I remove a remote branch from local repo that is removed at the server side
Date: Tue, 12 May 2009 09:32:15 +0200	[thread overview]
Message-ID: <4A0925FF.5030307@viscovery.net> (raw)
In-Reply-To: <4A091DB3.4070509@ubicom.com>

Yakup Akbay schrieb:
> Hi,
> 
> consider the following situation:
> 
>    adg@adghp:~/myrepo$ git branch -a
>    * master
>      origin/HEAD
>      origin/master
>      origin/work
> 
> I want to remove origin/work from my local repository which is no more
> existing at the origin. git fetch (or pull) does not help either.
> However, it disappears when I remove the following line in
> .git/packed-refs file:
> 
>    021a032317425b136b5430c7dead94328996b9d0 refs/remotes/origin/work
> 
> Is there command line version to do it?

Two options:

  git branch -D -r origin/work
  git remote prune origin

The second removes *all* of origin's tracking branches that are not in the
remote anymore. Use it only if you are sure you want that to happen.

-- Hannes

      parent reply	other threads:[~2009-05-12  7:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-12  6:56 How can I remove a remote branch from local repo that is removed at the server side Yakup Akbay
2009-05-12  7:27 ` Björn Steinbrink
2009-05-12  7:32 ` Johannes Sixt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A0925FF.5030307@viscovery.net \
    --to=j.sixt@viscovery.net \
    --cc=git@vger.kernel.org \
    --cc=yakbay@ubicom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).