Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / doc / install / clone-source.rst
1 =========================================
2  Cloning the Ceph Source Code Repository
3 =========================================
4
5 You may clone a Ceph branch of the Ceph source code by going to `github Ceph
6 Repository`_,  selecting a branch (``master`` by default), and clicking the
7 **Download ZIP** button.
8
9 .. _github Ceph Repository: https://github.com/ceph/ceph
10
11
12 To clone the entire git repository, install and configure ``git``.
13
14
15 Install Git
16 ===========
17
18 To install ``git`` on Debian/Ubuntu, execute::
19
20         sudo apt-get install git
21
22
23 To install ``git`` on CentOS/RHEL, execute::
24
25         sudo yum install git
26
27
28 You must also have a ``github`` account. If you do not have a
29 ``github`` account, go to `github.com`_ and register.
30 Follow the directions for setting up git at 
31 `Set Up Git`_.
32
33 .. _github.com: http://github.com
34 .. _Set Up Git: http://help.github.com/linux-set-up-git
35
36
37 Add SSH Keys (Optional)
38 =======================
39
40 If you intend to commit code to Ceph or to clone using SSH
41 (``git@github.com:ceph/ceph.git``), you must generate SSH keys for github. 
42
43 .. tip:: If you only intend to clone the repository, you may 
44    use ``git clone --recursive https://github.com/ceph/ceph.git`` 
45    without generating SSH keys.
46
47 To generate SSH keys for ``github``, execute::
48
49         ssh-keygen
50
51 Get the key to add to your ``github`` account (the following example
52 assumes you used the default file path)::
53
54         cat .ssh/id_rsa.pub
55
56 Copy the public key.
57
58 Go to your ``github`` account, click on "Account Settings" (i.e., the
59 'tools' icon); then, click "SSH Keys" on the left side navbar.
60
61 Click "Add SSH key" in the "SSH Keys" list, enter a name for the key, paste the
62 key you generated, and press the "Add key" button.
63
64
65 Clone the Source
66 ================
67
68 To clone the Ceph source code repository, execute::
69
70         git clone --recursive https://github.com/ceph/ceph.git
71
72 Once ``git clone`` executes, you should have a full copy of the Ceph 
73 repository.
74
75 .. tip:: Make sure you maintain the latest copies of the submodules
76    included in the repository. Running ``git status`` will tell you if
77    the submodules are out of date.
78
79 ::
80
81         cd ceph
82         git status
83
84 If your submodules are out of date, run::
85
86         git submodule update --force --init --recursive
87
88 Choose a Branch
89 ===============
90
91 Once you clone the source code and submodules, your Ceph repository 
92 will be on the ``master`` branch by default, which is the unstable 
93 development branch. You may choose other branches too.
94
95 - ``master``: The unstable development branch.
96 - ``stable``: The bugfix branch.
97 - ``next``: The release candidate branch.
98
99 ::
100
101         git checkout master