Gitlab搭建以及使用

Gitlab搭建以及使用描述 它是一个开源的版本管理系统 用来存放代码的仓库 可通过 web 管理 可以上传或下载存放在仓库上面的代码安装 1 编辑 yum 源 vim etc yum repos d gitlab ce repo gitlab ce name GitlabCERepo https mirrors tuna tsinghua edu cn gitlab ce yum el releasever gpgcheck 0enabled 12 更新

描述:它是一个开源的版本管理系统,用来存放代码的仓库,可通过 web 管理,可以上传或下载存放在仓库上面的代码

安装:

1.编辑 yum 源:vim /etc/yum.repos.d/gitlab-ce.repo

[gitlab-ce]

name=Gitlab CE Repository

baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el$releasever/

gpgcheck=0

enabled=1

2.更新 yum 缓存:yum makecache

3.安装:yum install gitlab-ce -y

4.编辑文件:vim /etc/gitlab/gitlab.rb

external_url ‘http://ip或域名’

5.初始化:gitlab-ctl reconfigure

6.查看状态:gitlab-ctl status

7.查看密码:cat /etc/gitlab/initial_root_password

8.登录:http://ip

使用:

拉取:

1.进入指定目录本地初始化:git init

2.查看:cd ./

3.添加源:git remote add origin http://192.168.8.114/root/test.git(git 项目的链接)

4.账号密码永久保存:git config –global credential.helper store

5.拉取:git pull origin main

上传:

1.进入指定目录本地初始化:git init

2.查看:cd ./

3.添加源:git remote add origin http://192.168.8.114/root/test.git(git 项目的链接)

4.添加文件:git add 1.txt(文件)

5.添加到本地库:git commit -m “Initial commit”

6.上传:git push -u origin master(注意:master为分支,注意分支)

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/231144.html原文链接:https://javaforall.net

(0)
上一篇 2026年1月25日 下午5:01
下一篇 2026年1月25日 下午5:22


相关推荐

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号