0

I'm following instructions for a kernel project and am told to:

Export the kernel to use from the repository at the URL:

git://git.yoctoproject.org/linux-yocto-3.14

You will need to switch to the 'v3.14.26' tag,

So I did:

git clone git://git.yoctoproject.org/linux-yocto-3.14

Once the project downloaded, I typed in:

git checkout 'v3.14.26'

and was greeted with a message about how I'm now in detached HEAD state. It also output the following:

HEAD is now at 356a3e1... Linux 3.14.26

But it seemed weird that nothing in the project downloaded or changed; I ran show-branch and was told [master] Merge tag 'v3.14.24'

So is the project actually at version 3.14.26 or not? I don't really get what's going on, though I think I understand what's happening with detached HEAD after reading about it. I'm not going to be making any changes to the solution, I'm just following the guide to use the specific 3.14.26 version of the kernel.

8protons
  • 3,591
  • 5
  • 32
  • 67
  • Read this excellent answer regrading detached HEAD http://stackoverflow.com/questions/34519665/how-to-move-head-back-to-a-previous-location-detached-head/34519716#34519716 – CodeWizard Jun 15 '16 at 01:17

1 Answers1

1

Keeping things simple, HEAD will only be attached if it's pointing to a Branch (something you can commit to). When you point your HEAD to a Tag, your working copy will be based on that commit, but since you cannot commit to a Tag, it will tell you are detached.

To make sure you are where you think you are, run:

git log --decorate=short --oneline --branches=*

If it places HEAD on the same commit as v3.14.26, you're good. Example:

λ git log --decorate=short --oneline --branches=*

bdeddd5 (origin/master, origin/HEAD, master) XXX
5250588 YYY
647f007 ZZZ
d5cc025 (HEAD, tag: v3.14.26) WWW
55736b0 PPP
everton
  • 7,579
  • 2
  • 29
  • 42
  • Thanks. So did I get the v3.14.26 version that I wanted? Or did I type in the wrong commands? – 8protons Jun 15 '16 at 00:50
  • You did right :) Your code is in fact on v3.14.26. Edit with some more info – everton Jun 15 '16 at 00:52
  • I executed the line you wrote and at the top of the list is `(origin/master, origin/HEAD, master) Merge tag 'v.3.14.24'` :/ And then below that is a ton of commits that only go back in version (.23, .22, etc.) – 8protons Jun 15 '16 at 00:56
  • If I re-execute `git chechout 'v3.14.26' it again tells me 'HEAD is now at 356a3el... Linux 3.14.26` yet when I use the line you told me, I see (among all the other commits) `Merge tag 'v3.14.24'. I don't see anything about the head being at v3.14.26 – 8protons Jun 15 '16 at 00:58
  • It probably is, but it's way behind the latest commits... try to grep on lines containing HEAD or this tag to make sure – everton Jun 15 '16 at 00:59
  • I grepped and found nothing at all saying I'm on v3.14.26 :/ – 8protons Jun 15 '16 at 01:02
  • Am I checkout wrong? Maybe I don't want to checkout? lol all I am trying to do is update from v3.14.24 to v3.14.26 – 8protons Jun 15 '16 at 01:04
  • You just need the code, right? You won't make any change to the repository nor care about git history. – everton Jun 15 '16 at 01:14
  • Yeah, just the code. I ended up typing `git show` and that showed me that I'm on 3.14.26 :P – 8protons Jun 15 '16 at 01:15
  • Great! If you think the answer helped you in any way, do not forget to accept it. – everton Jun 15 '16 at 02:07