2.4.2. Checking Out by Branch in Poky

When you clone the upstream poky repository, you have access to all its development branches. Each development branch in a repository is unique as it forks off the "master" branch. To see and use the files of a particular development branch locally, you need to know the branch name and then specifically check out that development branch.

Note

Checking out an active development branch by branch name gives you a snapshot of that particular branch at the time you check it out. Further development on top of the branch that occurs after check it out can occur.

  1. 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.

  2. Determine Existing Branch Names:

         $ git branch -a
         * master
           remotes/origin/1.1_M1
           remotes/origin/1.1_M2
           remotes/origin/1.1_M3
           remotes/origin/1.1_M4
           remotes/origin/1.2_M1
           remotes/origin/1.2_M2
           remotes/origin/1.2_M3
               .
               .
               .
           remotes/origin/pyro
           remotes/origin/pyro-next
           remotes/origin/rocko
           remotes/origin/rocko-next
           remotes/origin/sumo
           remotes/origin/sumo-next
           remotes/origin/thud
           remotes/origin/thud-next
           remotes/origin/warrior
                        

  3. Checkout the Branch: Checkout the development branch in which you want to work. For example, to access the files for the Yocto Project 2.7 Release (Warrior), use the following command:

         $ git checkout -b warrior origin/warrior
         Branch warrior set up to track remote branch warrior from origin.
         Switched to a new branch 'warrior'
                        

    The previous command checks out the "warrior" development branch and reports that the branch is tracking the upstream "origin/warrior" branch.

    The following command displays the branches that are now part of your local poky repository. The asterisk character indicates the branch that is currently checked out for work:

         $ git branch
           master
         * warrior