Similar to branches, the upstream repository uses tags to mark specific commits associated with significant points in a development branch (i.e. a release point or stage of a release). You might want to set up a local branch based on one of those points in the repository. The process is similar to checking out by branch name except you use tag names.
Switch to the Poky Directory:
If you have a local poky Git repository, switch to that
directory.
If you do not have the local copy of poky, see the
"Cloning the poky
Repository"
section.
Fetch the Tag Names: To checkout the branch based on a tag name, you need to fetch the upstream tags into your local repository:
$ git fetch --tags $
List the Tag Names: You can list the tag names now:
$ git tag 1.1_M1.final 1.1_M1.rc1 1.1_M1.rc2 1.1_M2.final 1.1_M2.rc1 . . . yocto-2.5 yocto-2.5.1 yocto-2.5.2 yocto-2.5.3 yocto-2.6 yocto-2.6.1 yocto-2.7 yocto_1.5_M5.rc8
Checkout the Branch:
$ git checkout tags/yocto-2.7 -b my_yocto_2.7 Switched to a new branch 'my_yocto_2.7' $ git branch master * my_yocto_2.7
The previous command creates and checks out a local
branch named "my_yocto_2.7", which is based on
the commit in the upstream poky repository that has
the same tag.
In this example, the files you have available locally
as a result of the checkout
command are a snapshot of the
"warrior" development branch at the point
where Yocto Project 2.7 was released.