git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Sunny Hoang <s7hoang@gmail.com>
To: git@vger.kernel.org
Subject: possible bug: --bare vs --mirror with respect to remote-tracking branches
Date: Thu, 1 Sep 2022 07:06:43 -0400	[thread overview]
Message-ID: <CAM+t+1aez80vs5939Td0emwqAhVHtKW0BZ412+RW8Tvm85W5eQ@mail.gmail.com> (raw)

Thank you for filling out a Git bug report!
Please answer the following questions to help us understand your issue.

What did you do before the bug happened? (Steps to reproduce your issue)
  git clone <url> --mirror
  git --git-dir=<dir> --work-tree=<working directory> branch -r

What did you expect to happen? (Expected behavior)
  Remote-tracking for branches is supposed to be included (and would show up in
  `git branch -r`)

What happened instead? (Actual behavior)
  No remote-tracking branches (`git branch -r` is empty)

What's different between what you expected and what actually happened?
  Should see `origin/HEAD`and so on...but it's still empty

Anything else you want to add:
  I found the solution here:

    https://stackoverflow.com/questions/38981470/git-clone-create-a-bare-clone-but-with-remote-tracking-branches-for-a-worktre

  `git config --local --add remote.origin.fetch
"+refs/heads/*:refs/remotes/origin/*"`  seems to do it.

  The original value was:
      [remote "origin"]
        ...
        fetch = +refs/*:refs/*

  Running that command added another line:
      [remote "origin"]
        ...
        fetch = +refs/*:refs/*
        fetch = +refs/heads/*:refs/remotes/origin/*

  Running `git remote update` afterwards gets me the desired remote-tracking.


Please review the rest of the bug report below.
You can delete any lines you don't wish to share.


[System Info]
git version:
git version 2.37.1
cpu: x86_64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
uname: Linux 5.18.14-arch1-1 #1 SMP PREEMPT_DYNAMIC Sat, 23 Jul 2022
11:46:17 +0000 x86_64
compiler info: gnuc: 12.1
libc info: glibc: 2.35
$SHELL (typically, interactive shell): /bin/bash


[Enabled Hooks]

                 reply	other threads:[~2022-09-01 11:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=CAM+t+1aez80vs5939Td0emwqAhVHtKW0BZ412+RW8Tvm85W5eQ@mail.gmail.com \
    --to=s7hoang@gmail.com \
    --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).