Cloning the Ceph Source Code Repository

You may clone a Ceph branch of the Ceph source code by going to github CephRepository, selecting a branch (master by default), and clicking theDownload ZIP button.

To clone the entire git repository, install and configure git.

Install Git

To install git on Debian/Ubuntu, execute:

  1. sudo apt-get install git

To install git on CentOS/RHEL, execute:

  1. sudo yum install git

You must also have a github account. If you do not have agithub account, go to github.com and register.Follow the directions for setting up git atSet Up Git.

Add SSH Keys (Optional)

If you intend to commit code to Ceph or to clone using SSH(git@github.com:ceph/ceph.git), you must generate SSH keys for github.

Tip

If you only intend to clone the repository, you mayuse git clone —recursive https://github.com/ceph/ceph.gitwithout generating SSH keys.

To generate SSH keys for github, execute:

  1. ssh-keygen

Get the key to add to your github account (the following exampleassumes you used the default file path):

  1. cat .ssh/id_rsa.pub

Copy the public key.

Go to your github account, click on “Account Settings” (i.e., the‘tools’ icon); then, click “SSH Keys” on the left side navbar.

Click “Add SSH key” in the “SSH Keys” list, enter a name for the key, paste thekey you generated, and press the “Add key” button.

Clone the Source

To clone the Ceph source code repository, execute:

  1. git clone --recursive https://github.com/ceph/ceph.git

Once git clone executes, you should have a full copy of the Cephrepository.

Tip

Make sure you maintain the latest copies of the submodulesincluded in the repository. Running git status will tell you ifthe submodules are out of date.

  1. cd ceph
  2. git status

If your submodules are out of date, run:

  1. git submodule update --force --init --recursive

Choose a Branch

Once you clone the source code and submodules, your Ceph repositorywill be on the master branch by default, which is the unstabledevelopment branch. You may choose other branches too.

  • master: The unstable development branch.

  • stable: The bugfix branch.

  • next: The release candidate branch.

  1. git checkout master