Skip to contentSkip to conversation

checking out branches: tracking vs. tags

DISCUSSION jfabernathy 3 participants 5 messages May 24, 2012

lore
Share & tools
lore
#0 lore raw

I'm trying to understand a few git concepts as they relate to Yocto. Reading the 1.2 version of the Development Manual Appendix A (http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#dev-manual-bsp-appendix), I see the statement:

  $ git checkout denzil-7.0 -b denzil

What I think this does is create me a local branch that is fixed to what was committed when the denzil-7.0 tag was created and it will remain that way and will not track the denzil branch as it gets updated. Right????

Now if I want to track the denzil branch as changes are committed, I think I do the following.

 $ git checkout origin/denzil -b denzil

Now I can do git pull commands to get the updates that are committed. Right??

Jim A

#1 lore raw
Quoted 11 lines · jfabernathy

the Development Manual Appendix A
(http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#dev-manual-bsp-appendix),
I see the statement:

 $ git checkout denzil-7.0 -b denzil

What I think this does is create me a local branch that is fixed to what was committed when the denzil-7.0 tag was created and it will remain that way and will not track the denzil branch as it gets updated.  Right????

Quoted 8 lines

Now if I want to track the denzil branch as changes are committed, I think I do the following.

 $ git checkout origin/denzil -b denzil

Now I can do git pull commands to get the updates that are committed. Right??

Your arguments are backwards. See git help checkout.

Signature · 1 line
Christopher Larson
#2 lore raw
Quoted 15 lines · Chris Larson
Quoted 14 lines · jfabernathy

the Development Manual Appendix A
(http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#dev-manual-bsp-appendix),
I see the statement:

  $ git checkout denzil-7.0 -b denzil

What I think this does is create me a local branch that is fixed to what was committed when the denzil-7.0 tag was created and it will remain that way and will not track the denzil branch as it gets updated. Right????

Now if I want to track the denzil branch as changes are committed, I think I do the following.

Quoted 6 lines
Quoted 5 lines
  $ git checkout origin/denzil -b denzil

Now I can do git pull commands to get the updates that are committed. Right??

Your arguments are backwards. See git help checkout.

I looked at git help and man git, but it is still unclear because if I do the first one where I checkout using the tag, I cannot git pull at all; I get an error, about not enough information to merge. However, if I use the name of the branch I can now do git pull when changes are committed to denzil. That's why I thought I understood it. But who knows.

Jim A

#3 lore raw
Quoted 28 lines · jfabernathy
Quoted 27 lines · Chris Larson
Quoted 23 lines · jfabernathy

the Development Manual Appendix A

(http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#dev-manual-bsp-appendix),
I see the statement:

 $ git checkout denzil-7.0 -b denzil

What I think this does is create me a local branch that is fixed to what was
committed when the denzil-7.0 tag was created and it will remain that way and will not track the denzil branch as it gets updated.  Right????

Now if I want to track the denzil branch as changes are committed, I think I
do the following.

 $ git checkout origin/denzil -b denzil

Now I can do git pull commands to get the updates that are committed. Right??

Quoted 7 lines
Quoted 1 line

Your arguments are backwards. See git help checkout.

I looked at git help and man git, but it is still unclear because if I do the first one where I checkout using the tag, I cannot git pull at all; I get an error, about not enough information to merge.  However, if I use the name of the branch I can now do git pull when changes are committed to denzil.  That's why I thought I understood it.  But who knows.

You're right, my mistake. Those commands are fine, and your understanding is largely correct. I highly recommend reading Pro Git for further information.

Signature · 1 line
Christopher Larson
#4 lore raw
Quoted 37 lines · Chris Larson
Quoted 28 lines · jfabernathy
Quoted 27 lines · Chris Larson
Quoted 23 lines · jfabernathy

the Development Manual Appendix A

(http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#dev-manual-bsp-appendix),
I see the statement:

  $ git checkout denzil-7.0 -b denzil

What I think this does is create me a local branch that is fixed to what was
committed when the denzil-7.0 tag was created and it will remain that way and will not track the denzil branch as it gets updated. Right????

Now if I want to track the denzil branch as changes are committed, I think I
do the following.

  $ git checkout origin/denzil -b denzil

Now I can do git pull commands to get the updates that are committed. Right??

Quoted 7 lines
Quoted 1 line

Your arguments are backwards. See git help checkout.

I looked at git help and man git, but it is still unclear because if I do the first one where I checkout using the tag, I cannot git pull at all; I get an error, about not enough information to merge. However, if I use the name of the branch I can now do git pull when changes are committed to denzil. That's why I thought I understood it. But who knows.

Quoted 3 lines

You're right, my mistake. Those commands are fine, and your understanding is largely correct. I highly recommend reading Pro Git for further information.

If you checkout the tag you get the source as it was when the tag was made, without being able to pull, as there's nothing new to be pulled (in detached head state, that's why you get an error). You may see it as a snapshot of the repository. If you checkout the branch, you'll pull commits brought to that remote branch.
Bye,

Signature · 1 line
Mihai Lindner