{"thread":{"id":"58387","subject":"possible bug: --bare vs --mirror with respect to remote-tracking branches","startedAt":"2022-09-01T11:07:02Z","lastAt":"2022-09-01T11:07:02Z","messageCount":1,"participants":["Sunny Hoang"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"462436","messageId":"CAM+t+1aez80vs5939Td0emwqAhVHtKW0BZ412+RW8Tvm85W5eQ@mail.gmail.com","threadId":"58387","inReplyTo":null,"subject":"possible bug: --bare vs --mirror with respect to remote-tracking branches","fromName":"Sunny Hoang","fromEmail":"s7hoang@gmail.com","sentAt":"2022-09-01T11:06:43Z","receivedAt":"2022-09-01T11:07:02Z","isPatch":false,"sender":{"key":"s7hoang@gmail.com","avatar":null},"body":"Thank you for filling out a Git bug report!\nPlease answer the following questions to help us understand your issue.\n\nWhat did you do before the bug happened? (Steps to reproduce your issue)\n  git clone <url> --mirror\n  git --git-dir=<dir> --work-tree=<working directory> branch -r\n\nWhat did you expect to happen? (Expected behavior)\n  Remote-tracking for branches is supposed to be included (and would show up in\n  `git branch -r`)\n\nWhat happened instead? (Actual behavior)\n  No remote-tracking branches (`git branch -r` is empty)\n\nWhat's different between what you expected and what actually happened?\n  Should see `origin/HEAD`and so on...but it's still empty\n\nAnything else you want to add:\n  I found the solution here:\n\n    https://stackoverflow.com/questions/38981470/git-clone-create-a-bare-clone-but-with-remote-tracking-branches-for-a-worktre\n\n  `git config --local --add remote.origin.fetch\n\"+refs/heads/*:refs/remotes/origin/*\"`  seems to do it.\n\n  The original value was:\n      [remote \"origin\"]\n        ...\n        fetch = +refs/*:refs/*\n\n  Running that command added another line:\n      [remote \"origin\"]\n        ...\n        fetch = +refs/*:refs/*\n        fetch = +refs/heads/*:refs/remotes/origin/*\n\n  Running `git remote update` afterwards gets me the desired remote-tracking.\n\n\nPlease review the rest of the bug report below.\nYou can delete any lines you don't wish to share.\n\n\n[System Info]\ngit version:\ngit version 2.37.1\ncpu: x86_64\nno commit associated with this build\nsizeof-long: 8\nsizeof-size_t: 8\nshell-path: /bin/sh\nuname: Linux 5.18.14-arch1-1 #1 SMP PREEMPT_DYNAMIC Sat, 23 Jul 2022\n11:46:17 +0000 x86_64\ncompiler info: gnuc: 12.1\nlibc info: glibc: 2.35\n$SHELL (typically, interactive shell): /bin/bash\n\n\n[Enabled Hooks]\n"}]}