gitlab安装和使用

gitlab安装和使用

1.下载必要的依赖

bash 复制代码
    sudo yum install curl openssh-server openssh-clients postfix cronie  #需要执行
    sudo service postfix start #配置邮箱的
    sudo chkconfig postfix on #配置邮箱的
    #这句是用来做防火墙的,避免用户通过ssh方式和http来访问。
    sudo lokkit -s http -s ssh

2.下载gitlab安装包

清华大学镜像源:https://mirror.tuna.tsinghua.edu.cn/help/gitlab-ce

下载完放到指定位置

进入目录安装命令

bash 复制代码
rpm -ivh ./gitlab-ce-14.10.5-ce.0.el7.x86_64.rpm

3.修改必要的配置文件

bash 复制代码
vim /etc/gitlab/gitlab.rb 
bash 复制代码
    #外部访问url(经过编译后,自动将这个配置编译到nginx配置,nginx就无需配置了)
    external_url 'http://192.168.0.1:8888'
    #默认值就是8080。如果端口被占用,可将8080修改为其它(例如:9090)
    unicorn['port'] = 8080  #gitlab版本不同,这个配置项可能不存在

4.是配置文件生效

bash 复制代码
    #使配置生效
    gitlab-ctl reconfigure
    #重新启动GitLab 
    gitlab-ctl restart

5.登录网页-默认密码

密码放在了一个临时文件中

密码位置:/etc/gitlab/initial_root_password

密码需要及时修改,24小时会自动删除

6.修改密码

http://110.42.188.114:8888/users/sign_in

root !QAZ2wsx

7.增加用户

8.测试分享代码

9.上传clone创建分支,提交代码

  • gitlab-ce-14初装以后,把密码放在了一个临时文件中了

常用的gitlab命令

bash 复制代码
    gitlab-ctl start    # 启动所有 gitlab 组件;
    gitlab-ctl stop        # 停止所有 gitlab 组件;
    gitlab-ctl restart        # 重启所有 gitlab 组件;
    gitlab-ctl status        # 查看服务状态;
    vim /etc/gitlab/gitlab.rb        # 修改gitlab配置文件;
    gitlab-ctl reconfigure        # 重新编译gitlab的配置;
    gitlab-rake gitlab:check SANITIZE=true --trace    # 检查gitlab;
    gitlab-ctl tail        # 查看日志;
    gitlab-ctl tail nginx/gitlab_access.log

git的使用

  1. 安装git yum install git

  2. 查看git 版本 git --version

  3. 配置git

    git config --global user.email "you@example.com" git config --global user.name "Your Name"

参考资料:CentOs7 安装Gitlab

相关推荐
dapeng-大鹏1 天前
记一次 GitLab Let‘s Encrypt 证书申请失败的排查与修复
gitlab
身如柳絮随风扬1 天前
使用 Docker 部署 GitLab 并分配用户账号 —— 保姆级教程
docker·容器·gitlab
鼎道开发者联盟2 天前
鼎享会 | 从手工到自动化:OpenClaw改造GitLab内部协作流程的全过程
自动化·gitlab·openclaw
ℳ₯㎕ddzོꦿ࿐3 天前
告别手工发版:用 GitLab CI/CD 打通前后端自动化部署的“任督二脉”
ci/cd·自动化·gitlab
ℳ₯㎕ddzོꦿ࿐3 天前
实战:在 Linux 系统用 Docker-Compose 优雅部署 GitLab 及防坑指南
linux·docker·gitlab
源图客3 天前
Linux(CentOS9)服务器部署gitlab-ce-18.11.1-ce.0.el9.x86_64.rpm
linux·服务器·gitlab
ℳ₯㎕ddzོꦿ࿐3 天前
实战篇:结合 GitLab CI/CD 实现 Spring Cloud 微服务自动化部署与防坑指南
spring cloud·ci/cd·gitlab
菜萝卜子4 天前
【Git】GitLab 18.9 全局服务器钩子(Server Hooks)官方规范与落地实践
服务器·git·gitlab
lilili也5 天前
Git、VScode、GitLab
git·vscode·gitlab
郭龙_Jack6 天前
Gitlab CICD流水线设计
gitlab