Ubuntu自建git服务器

Ubuntu 安装 gitlab-ce

sudo apt-get update
sudo apt-get install gitlab-ce

安装成功

 sudo apt-get install gitlab-ce
正在读取软件包列表... 完成
正在分析软件包的依赖关系树       
正在读取状态信息... 完成       
下列【新】软件包将被安装:
  gitlab-ce
升级了 0 个软件包,新安装了 1 个软件包,要卸载 0 个软件包,有 78 个软件包未被升级。
需要下载 1,085 MB 的归档。
解压缩后会消耗 3,101 MB 的额外空间。
获取:1 https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/ubuntu focal/main amd64 gitlab-ce amd64 16.5.0-ce.0 [1,085 MB]
已下载 1,085 MB,耗时 1分 41秒 (10.8 MB/s)                                                                       
正在选中未选择的软件包 gitlab-ce。
(正在读取数据库 ... 系统当前共安装有 260201 个文件和目录。)
准备解压 .../gitlab-ce_16.5.0-ce.0_amd64.deb  ...
正在解压 gitlab-ce (16.5.0-ce.0) ...
正在设置 gitlab-ce (16.5.0-ce.0) ...
It looks like GitLab has not been configured yet; skipping the upgrade script.

       *.                  *.
      ***                 ***
     *****               *****
    .******             *******
    ********            ********
   ,,,,,,,,,***********,,,,,,,,,
  ,,,,,,,,,,,*********,,,,,,,,,,,
  .,,,,,,,,,,,*******,,,,,,,,,,,,
      ,,,,,,,,,*****,,,,,,,,,.
         ,,,,,,,****,,,,,,
            .,,,***,,,,
                ,*,.
  


     _______ __  __          __
    / ____(_) /_/ /   ____ _/ /_
   / / __/ / __/ /   / __ `/ __ \
  / /_/ / / /_/ /___/ /_/ / /_/ /
  \____/_/\__/_____/\__,_/_.___/
  

Thank you for installing GitLab!
GitLab was unable to detect a valid hostname for your instance.
Please configure a URL for your GitLab instance by setting `external_url`
configuration in /etc/gitlab/gitlab.rb file.
Then, you can start your GitLab instance by running the following command:
  sudo gitlab-ctl reconfigure

For a comprehensive list of configuration options please see the Omnibus GitLab readme
https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md

Help us improve the installation experience, let us know how we did with a 1 minute survey:
https://gitlab.fra1.qualtrics.com/jfe/form/SV_6kVqZANThUQ1bZb?installation=omnibus&release=16-5

配置端口及网址

# 编辑文件
vim /etc/gitlab/gitlab.rb

external_url 'http://gitlab.example.com'
# 更改为如下
external_url 'http://<本机ip>:8899'

设置存储位置

        1.  拷贝原数据到新目录下。

cp -r /var/opt/gitlab/git-data/* /media/myradi5/data/gitlab-ce/data

        2.  /etc/gitlab/gitlab.rb中找到下面的字段,去除注释符,修改“path=”

git_data_dirs({
   "default" => {
     "path" => "/media/myradi5/data/gitlab-ce/data"
    }
 })

设置文件夹权限

sudo chmod 2770 /media/myradi5/data/gitlab-ce/data/

重新配置

sudo gitlab-ctl reconfigure
# 开启应用
sudo gitlab-ctl start

验证: 输入<IP>:8899

注册了用户,首次登录提示

登陆不上---------------------------------------------
 Your account is pending approval from your GitLab administrator and hence blocked. Please contact your GitLab 

首次需要在24小时内使用Root用户登录,密码在“ /etc/gitlab/initial_root_password”文件中。

授权新用户入口

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

hwj277

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值