git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC] git clone add option to track all remote branches

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 2, 2018, 03:21 UTC
Message-ID
<xmqqsh8ez41b.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<xmqqwoxqz56y.fsf@gitster-ct.c.googlers.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 10 quoted lines
> If you are really doing your own development, then you would have
> some topic branches of your own, with forks of some (but most likely
> not all, especiallyi when there are many branches at the upstream)
> branches you got from the upstream, and "git branch --list" that
> shows only your own and what you are interested in (i.e. those that
> you actually bothered to "git checkout <branchname>") without
> showing random other branches that exist at the remote but do not
> interest you is a feature.  Your hypothetical "clone" that
> indiscriminatedly forks all branches at remote locally will destroy
> the usefulness of it.

Related to this, a feature I have long thought we wished to have is complete opposite of this. After creating and working on a local topic branch and then concluding the work on it, a user would "git push" the branch out to a remote, and then check out a different branch (e.g. the 'master' branch). I wish we had a mode that would automatically *delete* the local topic branch that has already been pushed out (and more importantly, a branch that I have *done* with, at least for now), to unclutter my local branch namespace. When I want to further work on it, I can ask "git checkout" to dwim to recreate one on demand.

Of course, there are some wrinkles due to pesky impleemntation details (e.g. the "autonuke-and-recreate" would lose reflog), but I do not think it is fundamental hurdle.

Previous: Junio C HamanoNext: Randall S. Becker
Message 3 of 5 in “[RFC] git clone add option to track all remote branches”
  1. Yubin RuanApr 2, 2018
  2. Junio C HamanoApr 2, 2018
  3. Junio C HamanoApr 2, 2018
  4. Randall S. BeckerApr 2, 2018
  5. Ævar Arnfjörð BjarmasonApr 2, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.