From: Josh Triplett <josh@joshtriplett.org>
To: git@vger.kernel.org
Cc: Jamey Sharp <jamey@minilop.net>
Subject: Cloning a remote tag without using git-fetch-pack directly?
Date: Tue, 19 Apr 2011 15:20:53 -0700 [thread overview]
Message-ID: <20110419222050.GA3304@feather> (raw)
Using fetch-pack, I can clone a single tag from a repository:
/tmp/testrepo$ git init
Initialized empty Git repository in /tmp/testrepo/.git/
/tmp/testrepo$ git fetch-pack /home/josh/src/linux-2.6/.git refs/tags/v2.6.12
remote: Counting objects: 31617, done.
remote: Compressing objects: 100% (21083/21083), done.
Receiving objects: 100% (31617/31617), 52.56 MiB | 5.27 MiB/s, done.
remote: Total 31617 (delta 12862), reused 19495 (delta 10331)
Resolving deltas: 100% (12862/12862), done.
keep c80bd1def293bc11591159c96970d8becfe3b2d9
26791a8bcf0e6d33f43aef7682bdb555236d56de refs/tags/v2.6.12
/tmp/testrepo$ git show 26791a8bcf0e6d33f43aef7682bdb555236d56de | head -20
tag v2.6.12
This is the final 2.6.12 release
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQBCsykyF3YsRnbiHLsRAvPNAJ482tCZwuxp/bJRz7Q98MHlN83TpACdHr37
o6X/3T+vm8K3bf3driRr34c=
=sBHn
-----END PGP SIGNATURE-----
commit 9ee1c939d1cb936b1f98e8d81aeffab57bae46ab
Author: Linus Torvalds <torvalds@ppc970.osdl.org>
Date: Fri Jun 17 12:48:29 2005 -0700
Linux 2.6.12
diff --git a/Makefile b/Makefile
index 9e005e1..0d1e74d 100644
--- a/Makefile
However, I can't seem to find any way to convince git clone to do the
same thing for me. git clone will clone a branch, but not a tag.
/tmp/testrepo$ git clone /home/josh/src/linux-2.6/.git -b refs/tags/v2.6.12
Cloning into linux-2.6...
done.
warning: Remote branch refs/tags/v2.6.12 not found in upstream origin, using HEAD instead
On a different note, git fetch-pack seems to silently fail if asked to
fetch a remote tag which points at a tree object rather than a commit
object:
/tmp/testrepo$ git init
Initialized empty Git repository in /tmp/testrepo/.git/
/tmp/testrepo$ git fetch-pack /home/josh/src/linux-2.6/.git refs/tags/v2.6.12-tree
(1) /tmp/testrepo$ echo $?
1
I realize that I want to do something strange here, but it seems like a
kind of strange that git already supports in at least some ways, just
not in others. Am I missing something?
Thanks,
Josh Triplett
next reply other threads:[~2011-04-19 22:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-19 22:20 Josh Triplett [this message]
2011-04-20 6:26 ` Cloning a remote tag without using git-fetch-pack directly? Jeff King
2011-04-20 7:27 ` Josh Triplett
2011-04-20 7:38 ` Jeff King
2011-04-20 7:40 ` Jonathan Nieder
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110419222050.GA3304@feather \
--to=josh@joshtriplett.org \
--cc=git@vger.kernel.org \
--cc=jamey@minilop.net \
/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.
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 NNTP newsgroup(s).