2.2.5. Cloning the poky Repository

To use the Yocto Project, you need a release of the Yocto Project locally installed on your development system. The locally installed set of files is referred to as the Source Directory in the Yocto Project documentation.

You create your Source Directory by using Git to clone a local copy of the upstream poky repository.

Tip

The preferred method of getting the Yocto Project Source Directory set up is to clone the repository.

Working from a copy of the upstream repository allows you to contribute back into the Yocto Project or simply work with the latest software on a development branch. Because Git maintains and creates an upstream repository with a complete history of changes and you are working with a local clone of that repository, you have access to all the Yocto Project development branches and tag names used in the upstream repository.

Follow these steps to create a local version of the upstream poky Git repository.

  1. Set Your Directory: Be in the directory where you want to create your local copy of poky.

  2. Clone the Repository: The following command clones the repository and uses the default name "poky" for your local repository:

         $ git clone git://git.yoctoproject.org/poky
         Cloning into 'poky'...
         remote: Counting objects: 367178, done.
         remote: Compressing objects: 100% (88161/88161), done.
         remote: Total 367178 (delta 272761), reused 366942 (delta 272525)
         Receiving objects: 100% (367178/367178), 133.26 MiB | 6.40 MiB/s, done.
         Resolving deltas: 100% (272761/272761), done.
         Checking connectivity... done.
                        

    Unless you specify a specific development branch or tag name, Git clones the "master" branch, which results in a snapshot of the latest development changes for "master". For information on how to check out a specific development branch or on how to check out a local branch based on a tag name, see the "Checking Out By Branch in Poky" and Checking Out By Tag in Poky", respectively.

    Once the repository is created, you can change to that directory and check its status. Here, the single "master" branch exists on your system and by default, it is checked out:

         $ cd ~/poky
         $ git status
         On branch master
         Your branch is up-to-date with 'origin/master'.
         nothing to commit, working directory clean
         $ git branch
         * master
                        

    Your local repository of poky is identical to the upstream poky repository at the time from which it was cloned.