git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Duy Nguyen <pclouds@gmail.com>
To: Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: Missing branches after clone
Date: Tue, 14 May 2019 17:12:03 +0700	[thread overview]
Message-ID: <CACsJy8AX9Wp3W=d1=ozF9nZXGE1muooMf7fKCtdOOi1g8QRmig@mail.gmail.com> (raw)
In-Reply-To: <5CDA8D37020000A100031319@gwsmtp.uni-regensburg.de>

On Tue, May 14, 2019 at 4:42 PM Ulrich Windl
<Ulrich.Windl@rz.uni-regensburg.de> wrote:
>
> Hi!
>
> While wondering why some branches are not being displayed by "git branch" in a cloned repository, I was reading the obvious man pages (man git-branch, man git-remote), but still couldn't find the reason or the solution.

Local and remote branches are separate concepts. One big difference is
remote branches will be automatically updated when you get updates
from the remote repository, but local branches are only changed by
you.

So if you have to remote branches origin/master and origin/something.
If we automatically create the local branches 'master' and 'something'
for you, just so you can see it in 'git branch', then at the next 'git
fetch' (or 'git pull'), we're going to have a problem. The local
branches will stay the same old values while origin/master and
origin/something are kept uptodate. By the time you switch to and use
branch 'something'. there may be a surprise for you.

Besides, tracking all remote branches only works well when you have
one remote repository. Once you have another one, things get
complicated

> Then I found https://stackoverflow.com/questions/10312521/how-to-fetch-all-git-branches which handles the subject...
> But still the most common solution there still looks like an ugly hack.
> Thus I suggest to improve the man-pages (unless done already)

Yeah I expected to see at least some definition of remote-tracking
branches (vs local ones) but I didn't see one. Room for improvement.
-- 
Duy

  reply	other threads:[~2019-05-14 10:12 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-14  9:41 Missing branches after clone Ulrich Windl
2019-05-14 10:12 ` Duy Nguyen [this message]
2019-05-14 10:33   ` Philip Oakley
2019-05-14 10:53     ` Duy Nguyen
2019-05-14 11:10       ` Philip Oakley
2019-05-18 12:17         ` Duy Nguyen
2019-05-19  0:09           ` Philip Oakley
2019-05-14 11:49     ` Antw: " Ulrich Windl
2019-05-15  7:34       ` Philip Oakley
2019-05-15  8:45         ` Ulrich Windl
2019-05-15 13:07           ` Philip Oakley
2019-05-15  1:50     ` Junio C Hamano
2019-05-15  7:13       ` Philip Oakley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CACsJy8AX9Wp3W=d1=ozF9nZXGE1muooMf7fKCtdOOi1g8QRmig@mail.gmail.com' \
    --to=pclouds@gmail.com \
    --cc=Ulrich.Windl@rz.uni-regensburg.de \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).