{"thread":{"id":"19309","subject":"How can I remove a remote branch from local repo that is removed at the server side","startedAt":"2009-05-12T06:56:51Z","lastAt":"2009-05-12T07:32:15Z","messageCount":3,"participants":["Yakup Akbay","Björn Steinbrink","Johannes Sixt"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"113615","messageId":"4A091DB3.4070509@ubicom.com","threadId":"19309","inReplyTo":null,"subject":"How can I remove a remote branch from local repo that is removed at the server side","fromName":"Yakup Akbay","fromEmail":"yakbay@ubicom.com","sentAt":"2009-05-12T06:56:51Z","receivedAt":"2009-05-12T06:56:51Z","isPatch":false,"sender":{"key":"yakbay@ubicom.com","avatar":"https://gravatar.com/avatar/b1a445348437a895f93c412e183919a84c8b1298747b5e6f285b233225a274cf?d=mp&s=160"},"body":"Hi,\n\nconsider the following situation:\n\n    adg@adghp:~/myrepo$ git branch -a\n    * master\n      origin/HEAD\n      origin/master\n      origin/work\n\nI want to remove origin/work from my local repository which is no more \nexisting at the origin. git fetch (or pull) does not help either. \nHowever, it disappears when I remove the following line in \n.git/packed-refs file:\n\n    021a032317425b136b5430c7dead94328996b9d0 refs/remotes/origin/work\n\nIs there command line version to do it?\n\n\nRegards,\nYakup\n\n\nUbicom's HQ in Sunnyvale has Moved!\nOur New Address is:\n195 Baypointe Parkway\nSan Jose, CA 95134\n(408)433-3330 - Main#\n(408)433-3339 - Fax#\nwww.ubicom.com\n"},{"id":"113616","messageId":"20090512072743.GA24446@atjola.homenet","threadId":"19309","inReplyTo":"4A091DB3.4070509@ubicom.com","subject":"Re: How can I remove a remote branch from local repo that is removed at the server side","fromName":"Björn Steinbrink","fromEmail":"b.steinbrink@gmx.de","sentAt":"2009-05-12T07:27:43Z","receivedAt":"2009-05-12T07:27:43Z","isPatch":false,"sender":{"key":"b.steinbrink@gmx.de","avatar":"https://avatars.githubusercontent.com/u/230962?v=4"},"body":"On 2009.05.12 09:56:51 +0300, Yakup Akbay wrote:\n> Hi,\n>\n> consider the following situation:\n>\n>    adg@adghp:~/myrepo$ git branch -a\n>    * master\n>      origin/HEAD\n>      origin/master\n>      origin/work\n>\n> I want to remove origin/work from my local repository which is no more  \n> existing at the origin. git fetch (or pull) does not help either.  \n> However, it disappears when I remove the following line in  \n> .git/packed-refs file:\n>\n>    021a032317425b136b5430c7dead94328996b9d0 refs/remotes/origin/work\n>\n> Is there command line version to do it?\n\nTo manually delete the remote tracking branch:\n\tgit branch -r -d origin/work\n\nTo prune all remote tracking branches for \"origin\" for which the\ncorresponding branch on the remote is gone:\n\tgit remote prune origin\n\nBjörn\n"},{"id":"113617","messageId":"4A0925FF.5030307@viscovery.net","threadId":"19309","inReplyTo":"4A091DB3.4070509@ubicom.com","subject":"Re: How can I remove a remote branch from local repo that is removed at the server side","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2009-05-12T07:32:15Z","receivedAt":"2009-05-12T07:32:15Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Yakup Akbay schrieb:\n> Hi,\n> \n> consider the following situation:\n> \n>    adg@adghp:~/myrepo$ git branch -a\n>    * master\n>      origin/HEAD\n>      origin/master\n>      origin/work\n> \n> I want to remove origin/work from my local repository which is no more\n> existing at the origin. git fetch (or pull) does not help either.\n> However, it disappears when I remove the following line in\n> .git/packed-refs file:\n> \n>    021a032317425b136b5430c7dead94328996b9d0 refs/remotes/origin/work\n> \n> Is there command line version to do it?\n\nTwo options:\n\n  git branch -D -r origin/work\n  git remote prune origin\n\nThe second removes *all* of origin's tracking branches that are not in the\nremote anymore. Use it only if you are sure you want that to happen.\n\n-- Hannes\n"}]}