Re: [Newbie] How to *actually* get rid of remote tracking branch?
- From
Jakub Narebski <jnareb@gmail.com>
- Date
- Nov 13, 2007, 17:42 UTC
- Message-ID
- <200711131842.03622.jnareb@gmail.com>
- In-Reply-To
- <A919E788-C5D0-4404-95D4-869BAFE868AC@zib.de>
Steffen Prohaska wrote:
> On Nov 13, 2007, at 5:03 PM, Jakub Narebski wrote: >> Sergei Organov <osv@javad.com> wrote:
Show 12 quoted lines
>>> Isn't "git branch -d -r" supposed to do whatever magic is required to >>> get rid of the remote branch? Currently it seems like a bug >>> introduced by addition of wildcards refspecs, right? >> >> No, the '-r' part translates 'pu' into 'refs/remotes/origin/pu', and >> the '-d' option removes branch locally. It is meant I think to remove >> tracking of branches which were dropped in remote, as I think that >> wildcard refspec does create new branches, but do not delete dropped >> branches. > > "git remote prune origin" should be used to clean up stale > remote-tracking branches.
"git remote prune <name>" deletes _all_ stale tracking branches under <name>. With "git branch -d -r <branch>" you can delete _single_ tracking branch.
Show 6 quoted lines
>> So I'm not sure if it is a bug, misfeature or a feature. > > 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.
-- Jakub Narebski Poland