* How can I remove a remote branch from local repo that is removed at the server side
@ 2009-05-12 6:56 Yakup Akbay
2009-05-12 7:27 ` Björn Steinbrink
2009-05-12 7:32 ` Johannes Sixt
0 siblings, 2 replies; 3+ messages in thread
From: Yakup Akbay @ 2009-05-12 6:56 UTC (permalink / raw)
To: git
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?
Regards,
Yakup
Ubicom's HQ in Sunnyvale has Moved!
Our New Address is:
195 Baypointe Parkway
San Jose, CA 95134
(408)433-3330 - Main#
(408)433-3339 - Fax#
www.ubicom.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: How can I remove a remote branch from local repo that is removed at the server side
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
1 sibling, 0 replies; 3+ messages in thread
From: Björn Steinbrink @ 2009-05-12 7:27 UTC (permalink / raw)
To: Yakup Akbay; +Cc: git
On 2009.05.12 09:56:51 +0300, Yakup Akbay wrote:
> 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?
To manually delete the remote tracking branch:
git branch -r -d origin/work
To prune all remote tracking branches for "origin" for which the
corresponding branch on the remote is gone:
git remote prune origin
Björn
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: How can I remove a remote branch from local repo that is removed at the server side
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
1 sibling, 0 replies; 3+ messages in thread
From: Johannes Sixt @ 2009-05-12 7:32 UTC (permalink / raw)
To: Yakup Akbay; +Cc: git
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-05-12 7:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).