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 "[email protected]" git config --global user.name "Your Name"

参考资料:CentOs7 安装Gitlab

相关推荐
星释3 天前
如何自动部署GitLab项目
gitlab
keson要进步3 天前
CICD实战(二)-----gitlab的安装与配置
linux·运维·gitlab
猫头虎3 天前
[特殊字符]解决 “IDEA 登录失败。不支持早于 14.0 的 GitLab 版本” 问题的几种方法
java·ide·网络协议·http·https·gitlab·intellij-idea
风早君3 天前
jenkins集成gitlab发布到远程服务器
服务器·gitlab·jenkins
大白要努力!5 天前
在 Android Studio 中使用 GitLab 添加图片到 README.md
android·gitlab·android studio
星释5 天前
如何编写GitLab-CI配置文件
ci/cd·gitlab
馨羽的玩具5 天前
gitlab rss订阅失败
gitlab
t198751286 天前
jenkins结合gitlab实现CI
ci/cd·gitlab·jenkins
一颗小豆6 天前
07-接着玩-linux的CD/CI全流程体验
gitlab