gitlab操作指南

概述

GitLab是利用 Ruby on Rails 一個開源的版本管理系統,實現一個自託管的Git項目倉庫,可通過Web界面進行訪問公開的或者私人項目。它擁有與Github類似的功能,能夠瀏覽源代碼,管理缺陷和註釋。可以管理團隊對倉庫的訪問,它非常易於瀏覽提交過的版本並提供一個文件歷史庫。團隊成員可以利用內置的簡單聊天程序(Wall)進行交流。它還提供一個代碼片段收集功能可以輕鬆實現代碼複用,便於日後有需要的時候進行查找。

安裝

依賴組件:ruby 1.9.3+,MySQL,git,Redis, Sidekiq。 
最低配置CPU 1G,RAM 1G+swap可以支持100用戶。 
對於安裝這裏不做講解,https://about.gitlab.com/downloads/ 
這裏寫圖片描述 
注:默認同時安裝了GitLab CI, 後然配置Apache的端口,MySQL的端口,注意如果默認端口80, 3306有佔用,需要修改。就不截圖 了。 
這個包默認會安裝獨立的MySQL,如果需要配置已有Mysql數據庫,那麼請手工逐個安裝各個組件。安裝完成後,服務就啓動了。 
配置OS自動啓動:

sudo update-rc.d gitlab defaults 21
  • 1
  • 1

一些常用的命令

root@ubuntu:/opt/gitlab-7.1.1-0# ./ctlscript.sh start

140818 00:31:57 mysqld_safe Logging to '/opt/gitlab-7.1.1-0/mysql/data/mysqld.log'.

140818 00:31:57 mysqld_safe Starting mysqld.bin daemon with databases from /opt/gitlab-7.1.1-0/mysql/data

/opt/gitlab-7.1.1-0/mysql/scripts/ctl.sh : mysql started at port 3307

/opt/gitlab-7.1.1-0/redis/scripts/ctl.sh : redis started at port 6379

/opt/gitlab-7.1.1-0/apps/gitlab/scripts/sidekiq.sh : gitlab_sidekiq started

Session terminated, terminating shell... ...terminated.

/opt/gitlab-7.1.1-0/apps/gitlabci/scripts/sidekiq.sh : gitlabci_sidekiq started

/opt/gitlab-7.1.1-0/apps/gitlabci/scripts/runner.sh : gitlabci_runner started

Syntax OK

/opt/gitlab-7.1.1-0/apache2/scripts/ctl.sh : httpd started at port 81

:/opt/gitlab-7.1.1-0Gitlab的安裝目錄

也可以查看GUI管理控制檯 ./manager-linux-x64.run
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25

項目管理

安裝完成之後,輸入我們的登錄地址。 
這裏寫圖片描述

創建與Git項目初始化工作

如我們的gitLab的地址,http://gitlab.hiwemeet.com/ 
這裏寫圖片描述

新建項目

可創建三種級別的Projects(private,public,internal): 
這裏寫圖片描述

我們選擇創建一個私有項目: 
這裏寫圖片描述

上傳項目

這裏寫圖片描述 
上傳的時候可以配置ssh,也可以不用ssh的,大家根據實際需要。 
然後使用github的客戶端工具gitbash上傳代碼,用到的命令如下,也就是上圖的截圖:

Git global setup(Git全局設置):

git config --global user.name "testman"
git config --global user.email "[email protected]"

Create Repository(創建倉庫)
mkdir common-util
cd common-util
git init
touch README
git add README
git commit -m 'first commit'
git remote add origin git@127.0.0.1:devteam/common-util.git
git push -u origin master

//對於已存在Git項目:
cd existing_git_repo 
git remote add origin git@127.0.0.1:devteam/common-util.git 
git push -u origin master
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19

添加項目成員

這個項目如果是私人的,如果你是合作開發,需要添加項目成員。打開項目的“setting”,在左邊找到member,然後選擇。 
這裏寫圖片描述

刪除項目

進入項目頁面“setting”,找到(Show it to me)點擊一下,就會顯示出紅色區域,在最下面有按鈕: 
“Remove project”。 
這裏寫圖片描述 
這裏寫圖片描述

附件:https://www.gitlab.cc/downloads/

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章