From: Lars Hjemli Date: Tue, 13 Nov 2007 18:17:51 GMT Subject: Re: [Newbie] How to *actually* get rid of remote tracking branch? Message-ID: <8c5c35580711131017p451f831bqd928ef033c9a0e98@mail.gmail.com> In-Reply-To: <87d4ue81tv.fsf@osv.gnss.ru> On Nov 13, 2007 6:58 PM, wrote: > Jakub Narebski writes: > > Steffen Prohaska wrote: > >> It doesn't make sense to delete remote-tracking branches > >> locally if they are still present at the remote. The main > >> purpose of a remote-tracking branch is to be identical to the > >> real remote branch. > > > > True, but it would be nice to have an option to _exclude_ some > > branches from fetching (for example 'html' and 'man' branches > > of git.git), while still picking up new branches automatically > > on fetch. > > Guys, could you please read man git-branch? I understand that the man-page could be confusing, the problem is that these examples are quite old: they made more sense when git didn't support wildcards in refspecs. You want an easy way to tell git to stop tracking the pu-branch. This can be achieved by editing the [remote "origin"] section in .git/config: remove the fetch-line containing refs/heads/* and add one fetch line for each ref you'd like to track. But beware that you have to add any new branches which you would like to track in the same way (editing .git/config). The reason git-branch -d -r doesn't do this automatically is probably that nobody has seen a need for it to do so... -- larsh