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

相关推荐
极小狐17 小时前
极狐GitLab 补丁版本:19.2.1、19.1.3、19.0.5
网络·安全·gitlab·极狐gitlab·安全更新·补丁版本
rustfs2 天前
GitLab 如何与 RustFS 集成?
分布式·rust·gitlab
郝亚军3 天前
gitlab常用命令
gitlab
xixingzhe27 天前
Java 使用 GitLab4J 实现 WebHook
gitlab
童槿顏丶8 天前
GitLab部署到Linux
linux·运维·gitlab
InfinitePlus9 天前
Gitlab docker版本安装
docker·容器·gitlab
进击切图仔9 天前
GitLab 新用户创建与项目授权操作指南
gitlab
技术小结-李爽9 天前
【工具】git与gitee和gitlab和github等等有什么区别?
git·gitee·gitlab
xiaoxiangsiyan10 天前
GitLab CI/CD 自托管(EE 企业版)+ Kubernetes Runner 集群 + ArgoCD(GitOps 部署)
运维·网络·ci/cd·容器·kubernetes·gitlab·argocd
csdn2015_18 天前
vscode从gitlab拉项目到本地
vscode·gitlab