blob: 76a4d7533182e3dedf5236c2c7fe4d18eebea7f2 [file] [log] [blame]
seshukmec1cf232018-08-22 15:49:51 +08001.. This work is licensed under a Creative Commons Attribution 4.0 International License.
2.. http://creativecommons.org/licenses/by/4.0
3.. Copyright 2017 Huawei Technologies Co., Ltd.
4
5Configure git and gerrit
6========================
7
8Basics
9------
10The recommended version of git is 2.7.4 or later. Check the installed version in the Ubuntu VM:
11
12.. code-block:: bash
13
14 git --version
15
16Create an SSH key to user with gerrit. Use no passphrase.
17
18.. code-block:: bash
19
20 ssh-keygen -t rsa
21
22Enter your SSH public key (id_rsa) into gerrit:
23
24- Browse to https://gerrit.onap.org
25- Log in
26- Open the menu next to your name (under the green search button)
27
Katsiaryna Kazak/ONAP (NC) /SRPOL/Engineer/삼성전자efb2a582019-07-25 16:08:58 +020028.. image:: ../images/Configure_git_1.png
seshukmec1cf232018-08-22 15:49:51 +080029
30- Select "Settings"
31- In the "Settings" sidebar, click "SSH Public Keys"`
32- Click "Add Key..."
33- Paste the entire contents of $HOME/.ssh/id_rsa.pub into the text area and click "Add".
34
Katsiaryna Kazak/ONAP (NC) /SRPOL/Engineer/삼성전자efb2a582019-07-25 16:08:58 +020035.. image:: ../images/Configure_git_2.png
seshukmec1cf232018-08-22 15:49:51 +080036
37Install the git-review package.
38
39.. code-block:: bash
40
41 sudo apt update
42 sudo apt install git-review
43
44Create $HOME/.gitconfig (replace highlighted values with your own information):
45 [user]
46
47 name = FirstName LastName
48
49 email = you@yourcompany.com
50
51 [core]
52
53 autocrlf = false
54
55 [merge]
56
57 tool = vimdiff
58
59 [gitreview]
60
61 username = YourLinuxFoundationId
62
63**If you're behind a corporate firewall and your proxy server has SOCKS support...**
64
65You may be able to use the SSH protocol with git, which is preferred versus HTTP. This method is known to work in the AT&T corporate network.
66Install the socat package, which allows you to tunnel SSH connections through a proxy that supports SOCKS:
67
68.. code-block:: bash
69
70 sudo apt update
71 sudo apt install socat
72
73Create (or append to) $HOME/.ssh/config (replace highlighted values with your information)
74
75 Host gerrit.onap.org
76
77 User userid
78
79 Hostname gerrit.onap.org
80
81 ProxyCommand socat - PROXY:host:%h:%p,proxyport=port
82
83 IdentityFile /home/userid/.ssh/id_rsa
84
85 ServerAliveInterval 10
86
87Verify that you have connectivity to gerrit through the proxy. Answer "yes" to continue connecting, if prompted.
88
89.. code-block:: bash
90
91 ssh -p 29418 gerrit.onap.org
92
Katsiaryna Kazak/ONAP (NC) /SRPOL/Engineer/삼성전자efb2a582019-07-25 16:08:58 +020093.. image:: ../images/Configure_git_3.png