-1

I am trying to clone a specific version of the QEMU source code from the repo here:

http://git.qemu.org/qemu.git

How can I go about cloning version 1.2 from the REPO, I see that it is labeled as a "Head" but I don't really understand what that means in terms of git. I've looked around for an answer but can't seem to find anything

eckes
  • 10,103
  • 1
  • 59
  • 71
Bubo
  • 768
  • 4
  • 18
  • 34
  • heads is a missleading label for "branches" in the GitWeb application used to present the repo in the browser. If you check out a branch, it will use its latest version aka "head", that is why it is named heads - I think. – eckes Jul 29 '14 at 19:35
  • This is a very specific question that is answered by the more general: http://stackoverflow.com/questions/1778088/how-to-clone-a-single-branch-in-git – Conspicuous Compiler Jul 29 '14 at 19:42
  • I'm sorry, I just didnt't understand the way their repository was set up. – Bubo Jul 30 '14 at 16:20

1 Answers1

2

A HEAD would be the tip or "last/latest commit" of a branch. Though honestly, this is the first time I've seen a list of branches listed as a list of heads

To get that revision, assuming you already have a clone of the repository and are in that directory:

git checkout stable-1.2

A git GUI is sometimes useful as a visualization tool for branch structures, I use SourceTree on Mac and Windows for this and there are others for other OSes.

Angelo Genovese
  • 3,398
  • 17
  • 23
  • So..I cloned the repo, ended up with a directory labeled "qemu" with the source. When I cd into the directory and issue that command, I get the following message: Branch stable-1.2 set up to track remote branch stable-1.2 from origin. Switched to a new branch 'stable-1.2', what do I do now? – Bubo Jul 29 '14 at 19:25
  • @Bubo You now have the source. – eckes Jul 29 '14 at 19:29
  • But it didn't seem to download anything new? – Bubo Jul 29 '14 at 19:29
  • You can also use `git clone -b stable-1.2 http://git.qemu.org/qemu.git` which will use the named branch. Or `-b v1.2.2` for a more specific version (in this case the same). – eckes Jul 29 '14 at 19:31
  • 1
    @Bubo Git does download all files for all versions when you clone (unless you tell it not to). when you do a checkout it copies the right files into place (from its local clone in the .git directory). – eckes Jul 29 '14 at 19:32