GitLab是利用 Ruby on Rails 一个开源的版本管理系统,实现一个自托管的Git项目仓库,可通过Web界面进行访问公开的或者私人项目。它拥有与Github类似的功能,能够浏览源代码,管理缺陷和注释。可以管理团队对仓库的访问,它非常易于浏览提交过的版本并提供一个文件历史库。团队成员可以利用内置的简单聊天程序(Wall)进行交流。它还提供一个代码片段收集功能可以轻松实现代码复用,便于日后有需要的时候进行查找。
[root@gitlab-machine ~]# ls -l gitlab-ce-8.7.0-ce.0.el6.x86_64.rpm -rwxr-xr-x 1 root root 261779557 May 2 14:06 gitlab-ce-8.7.0-ce.0.el6.x86_64.rpm
[root@gitlab-machine ~]# rpm -ivh gitlab-ce-8.7.0-ce.0.el6.x86_64.rpm Preparing... ########################################### [100%] 1:gitlab-ce ########################################### [100%] hostname: Host name lookup failure gitlab: Thank you for installing GitLab! gitlab: To configure and start GitLab, RUN THE FOLLOWING COMMAND:
sudo gitlab-ctl reconfigure
gitlab: GitLab should be reachable at http://gitlab.example.com gitlab: Otherwise configure GitLab for your system by editing /etc/gitlab/gitlab.rb file gitlab: And running reconfigure again. gitlab: gitlab: For a comprehensive list of configuration options please see the Omnibus GitLab readme gitlab: https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md gitlab: It looks like GitLab has not been configured yet; skipping the upgrade script.
4.Configure and start GitLab
1 2 3 4 5 6 7 8 9 10 11 12 13 14
[root@gitlab-machine ~]# sudo gitlab-ctl reconfigure Starting Chef Client, version 12.6.0 ...omit... Running handlers: Running handlers complete Chef Client finished, 221/300 resources updated in 01 minutes 24 seconds gitlab Reconfigured!
On your first visit, you’ll be redirected to a password reset screen to provide the password for the initial administrator account. Enter your desired password and you’ll be redirected back to the login screen.
The default account’s username is root. Provide the password you created earlier and login. After login you can change the username if you wish.
[root@gitlab-machine ~]# ssh-keygen -t rsa -C "[email protected]" Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): Created directory '/root/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /root/.ssh/id_rsa. Your public key has been saved in /root/.ssh/id_rsa.pub. The key fingerprint is: 05:07:1c:92:ec:ec:79:cd:09:96:a3:8e:a3:13:bf:e2 [email protected] The key's randomart image is: +--[ RSA 2048]----+ | ..o+o. | | o..o | | o .. | | o =. | | . +S= . | | . + . + | | o o . | | o + . | | .E+.o | +-----------------+
[root@gitlab-machine data]# git clone [email protected]:xujiang/test.git Initialized empty Git repository in /data/test/.git/ The authenticity of host 'gitlab.itweet.cn (192.168.1.125)' can't be established. RSA key fingerprint is d4:2d:bb:87:cf:41:ff:fd:64:b7:66:56:45:f2:d1:64. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'gitlab.itweet.cn,192.168.1.125' (RSA) to the list of known hosts. remote: Counting objects: 6, done. remote: Compressing objects: 100% (4/4), done. Receiving objects: 100% (6/6), 4.30 KiB, done. remote: Total 6 (delta 0), reused 0 (delta 0)
[root@gitlab-machine data]# pwd /data
[root@gitlab-machine data]# tree . └── test ├── LICENSE └── README.md
I. 如果提示:“You won’t be able to pull or push project code via SSH until you add an SSH key to your profile Don’t show again | Remind later” 解决:需要本地配置.ssh免密码登录,可以通过ssh隧道git clone项目,效率会高得多。