git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* possible bug: --bare vs --mirror with respect to remote-tracking branches
@ 2022-09-01 11:06 Sunny Hoang
  0 siblings, 0 replies; only message in thread
From: Sunny Hoang @ 2022-09-01 11:06 UTC (permalink / raw)
  To: git

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]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-09-01 11:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-01 11:06 possible bug: --bare vs --mirror with respect to remote-tracking branches Sunny Hoang

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).