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

Is there a way to get 'git fetch --no-tags' semantics with 'git clone'?

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Apr 14, 2017, 21:28 UTC
Message-ID
<CACBZZX584QwjphGfEgTn2V9P0yVkYSxfE1_Gp96bno8186SDyA@mail.gmail.com>

As far as I can tell the only way to clone a given upstream repo, which has an unknown main branch name without any tags is:

    git clone --single-branch <url> <repo> &&
    cd <repo> &&
    git tag -d $(git tag -l) &&
    git config remote.origin.tagOpt --no-tags
Is there really nothing like:
    git clone --single-branch --no-tags <url> <repo>
?

I suppose this can be done with the usual 'git init`, set the config & then fetch dance, but in that case what part of 'git remote' or friends exposes finding the remote "main" ref as --single-branch does?

Next: Ævar Arnfjörð Bjarmason
Message 1 of 11 in “Is there a way to get 'git fetch --no-tags' semantics with 'git clone'?”
  1. Ævar Arnfjörð BjarmasonApr 14, 2017
  2. clone: add a --no-tags option to clone without tagsÆvar Arnfjörð Bjarmason, Apr 18, 2017
  3. Ævar Arnfjörð BjarmasonApr 18, 2017
  4. Brandon WilliamsApr 18, 2017
  5. Junio C HamanoApr 19, 2017
  6. Junio C HamanoApr 19, 2017
  7. clone: add a --no-tags option to clone without tagsÆvar Arnfjörð Bjarmason, Apr 19, 2017
  8. Jonathan NiederApr 25, 2017
  9. Junio C HamanoApr 26, 2017
  10. Ævar Arnfjörð BjarmasonApr 26, 2017
  11. Jonathan NiederApr 25, 2017

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.