Community
Participate
Working Groups
According to 'man git-clone' [1], it should be possible to clone repository and checkout a tag: --branch <name> -b <name> ... --branch can also take tags and detaches the HEAD at that commit in the resulting repository. > git clone --branch v3.0.0.201306101825-r https://git.eclipse.org/r/egit/egit tmp/git-clone-tag-egit Cloning into 'tmp/git-clone-tag-egit'... remote: Counting objects: 49920, done remote: Finding sources: 100% (49920/49920) remote: Total 49920 (delta 21587), reused 43550 (delta 21587) Receiving objects: 100% (49920/49920), 36.64 MiB | 461.00 KiB/s, done. Resolving deltas: 100% (21587/21587), done. Checking connectivity... done Note: checking out 'f85dc228e3e67b229c978f751a8723a5c810738b'. > git --version git version 1.8.4 But JGit fails for the same args: > jgit clone --branch v3.0.0.201306101825-r https://git.eclipse.org/r/egit/egit tmp/jgit-clone-tag-egit Initialized empty Git repository in /home/mn/tmp/jgit-clone-tag-egit/.git remote: Counting objects: 45422 remote: Finding sources: 100% (49920/49920) Receiving objects: 100% (49920/49920) Resolving deltas: 100% (21587/21587) Updating references: 100% (56/56) remote: Counting objects: 49920, done remote: Total 49920 (delta 21587), reused 43550 (delta 21587) From https://git.eclipse.org/r/egit/egit * [new branch] master -> origin/master ... skip bunch of refs * [new tag] v3.0.0.201306101825-r -> v3.0.0.201306101825-r ... skip another bunch of refs fatal: no such remote ref: 'v3.0.0.201306101825-r' exit status: 128 > jgit version jgit version 3.1.0.201310021548-r [1] https://www.kernel.org/pub/software/scm/git/docs/git-clone.html