Checkout a tag from a private GitHub repository

前端 未结 3 976
星月不相逢
星月不相逢 2020-12-20 01:23

I need to clone a private repository from GitHub, but I only want to get a specific tag (so basically, cloning is actually the wrong term for it).

Now, the

3条回答
  •  再見小時候
    2020-12-20 01:43

    Note: git clone --single-branch --branch tag can work but.. forget intermediate tags in case of tag chaining!

    See commit b773dde, commit ab51783, commit 948a7fd, commit 2076353, commit 1962d9f (07 Sep 2016) by Jeff King (peff).
    (Merged by Junio C Hamano -- gitster -- in commit 9883ec2, 15 Sep 2016)

    pack-objects: walk tag chains for --include-tag

    "git pack-objects --include-tag" was taught that when we know that we are sending an object C, we want a tag B that directly points at C but also a tag A that points at the tag B.
    We used to miss the intermediate tag B in some cases.

    What happens if we have a chain of tags (e.g., tag "A" points to tag "B", which points to commit "C")?

    We'll peel down to "C" and realize that we want to include tag "A", but we do not ever consider tag "B", leading to a broken pack (assuming "B" was not otherwise selected).

    This is fixed in Git 2.11 (Q4 2016)

提交回复
热议问题