Gitlab使用

01. 外观配置

02. Gitlab汉化配置

1、下载汉化补丁
git clone https://gitlab.com/xhang/gitlab.git
2、查看全部分支版本
git branch -a
3、对比版本、生成补丁包
git diff remotes/origin/10-2-stable remotes/origin/10-2-stable-zh > ../10.2.2-zh.diff
4、停止服务器
gitlab-ctl stop
5、打补丁
patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 < /tmp/10.2.2-zh.diff
6、启动和重新配置
gitlab-ctl start
gitlab-ctl reconfigure

03. 注册限制

04. 创建用户及组

05. 创建用户

06. 把用户添加到组

07. 创建项目

返回首页,进入项目

#删除github的仓库
[root@git ~/git_data]# git remote remove origin
[root@git ~/git_data]# git remote
#添加gitlab的远程仓库,进行代码上传
[root@git ~/git_data]# git remote add origin git@10.0.0.100:OPS/git_test.git
[root@git ~/git_data]# git push -u origin master
The authenticity of host '10.0.0.100 (10.0.0.100)' can't be established.ECDSA key fingerprint is
SHA256:6gbyCCIw3zFuNSUR2Y7UOG8fbSrj/BVUaeXwllvrGXM.
ECDSA key fingerprint is
MD5:95:10:02:7c:71:73:c6:4a:b2:f9:d8:88:5d:4a:3d:e0.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '10.0.0.100' (ECDSA) to the list of known hosts.
Counting objects: 17, done.
Compressing objects: 100% (8/8), done.
Writing objects: 100% (17/17), 1.25 KiB | 0 bytes/s, done.
Total 17 (delta 1), reused 0 (delta 0)
To git@10.0.0.100:OPS/git_test.git
* [new branch] master -> master
Branch master set up to track remote branch master from origin.

08. 推送代码到Gitlab

[root@git ~/git_data]# echo oldboy >>a.txt
[root@git ~/git_data]# git add .
[root@git ~/git_data]# git commit -m "create a.txt"
[master a5c15de] create a.txt
1 file changed, 1 insertion(+)
create mode 100644 a.txt
[root@git ~/git_data]# git push -u origin master
Counting objects: 4, done.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 289 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To git@10.0.0.100:OPS/git_test.git
0924a70..a5c15de master -> master
Branch master set up to track remote branch master from origin.

刷新Gitlab仓库

09. 开发推送代码到Gitlab

#给其创建dev用户,并给其分配到项目组,然后进行登录

#克隆一台服务器,作为开发人员使用,并进行生成密钥文件,进行密钥认证

[root@dev ~]# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Created directory '/root/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:qx5BldjQ4qy+HTSH9zpg8nVQqJDNP/M8gfq/4k+E09c root@dev
The key's randomart image is:
+---[RSA 2048]----+
| +.=.o |
| o =.= . |
| +.+ o |
| .+.*o. . |
| .=.S*o.. E |
| o.+=.==. |
| . +o+..o. |
| ...++o |
| .o+.o=+. |
+----[SHA256]-----+
[root@dev ~]# cat .ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDa4HBEOk10oode36lPcrybpjK++3bsjbaO67CjzY9S8w2WbAFfsVUwM+Hz8uRlehfjiCxuXF/oQgK2TATDdVYw89CrUMMmjuR1nRKKslA/Xhj0XxIjtUY+86UpVYp0t3963mmHrvoe45DTHYHIQqHEP8FM1fi5T6EzYrVhWFmmjqQYbVYQL+4oHwJBsCvQ4XZ6PCgTBlw2D8s1jk2Sx2vTsPLURA/+iL7WqzM5bGQLcAP5R3yG09v5O0+C/RLIHMw/qY54DaxVGTXhs0PnrfQhdzlUcKREsGkF7Ya3khyfss1jY+/QslS3Y6be9s8sfBKuWwx3Llob2nkgKiZOpQ+5 root@dev

复制其公钥

#进行将代码克隆下来,进行更改
[root@dev ~]# git clone git@10.0.0.100:OPS/git_test.git
Cloning into 'git_test'...
The authenticity of host '10.0.0.100 (10.0.0.100)' can't be established.
ECDSA key fingerprint is
SHA256:6gbyCCIw3zFuNSUR2Y7UOG8fbSrj/BVUaeXwllvrGXM.
ECDSA key fingerprint is
MD5:95:10:02:7c:71:73:c6:4a:b2:f9:d8:88:5d:4a:3d:e0.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '10.0.0.100' (ECDSA) to the list of known hosts.
remote: Counting objects: 20, done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 20 (delta 1), reused 0 (delta 0)
Receiving objects: 100% (20/20), done.
Resolving deltas: 100% (1/1), done.
[root@dev ~]# ll
drwxr-xr-x 3 root root 52 Nov 17 17:21 git_test
[root@dev ~]# ll git_test/
total 8
-rw-r--r-- 1 root root 16 Nov 17 17:21 a
-rw-r--r-- 1 root root 7 Nov 17 17:21 a.txt
-rw-r--r-- 1 root root 0 Nov 17 17:21 test #修改代码
[root@dev ~]# cd git_test/
[root@dev ~/git_test]# echo dev01 >> a
[root@dev ~/git_test]# git commit -am "dev01 add a" *** Please tell me who you are.
Run
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: unable to auto-detect email address (got 'root@dev.(none)')
#配置邮件及用户信息
[root@dev ~/git_test]# git config --global user.email
"dev@example.com"
[root@dev ~/git_test]# git config --global user.name
"dev01"
[root@dev ~/git_test]# git commit -am "dev01 add a"
[master 6cc6aff] dev01 add a
1 file changed, 1 insertion(+)
#推送到远程仓库
[root@dev ~/git_test]# git push -u origin master
Counting objects: 5, done.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 305 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To git@10.0.0.100:OPS/git_test.git
a5c15de..6cc6aff master -> master
Branch master set up to track remote branch master from origin.

10. 分支保护

#创建一个dev分支

[root@dev ~/git_test]# git branch dev
[root@dev ~/git_test]# git push -u origin dev
Total 0 (delta 0), reused 0 (delta 0)
remote:
remote: To create a merge request for dev, visit:
remote: http://10.0.0.100/OPS/git_test/
merge_requests/new?merge_request%5Bsource_branch%5D=dev
remote:
To git@10.0.0.100:OPS/git_test.git
* [new branch] dev -> dev
Branch dev set up to track remote branch dev from origin.
#登录root用户,进行分支保护

11. 代码合并

#清除旧的分支,创建新的分支,并切换

[root@dev ~/git_test]# git branch -d dev
Deleted branch dev (was 6cc6aff).
[root@dev ~/git_test]# git checkout -b dev
Switched to a new branch 'dev'
[root@dev ~/git_test]# git branch* dev
master
#推送到远程仓库
[root@dev ~/git_test]# git push -u origin dev
Counting objects: 5, done.Compressing objects: 100% (2/2), done.Writing objects: 100% (3/3), 311 bytes | 0 bytes/s, done.Total 3 (delta 0), reused 0 (delta 0)remote:remote: To create a merge request for dev, visit:remote: http://10.0.0.100/OPS/git_test/merge_requests/new?merge_request%5Bsource_branch%5D=devremote:To git@10.0.0.100:OPS/git_test.git6cc6aff..315f127 dev -> devBranch dev set up to track remote branch dev from origin.#dev分支上面有a文件的最新信息,而master中没有

进行合并分支

登录root用户进行处理请求

Git --05 Gitlab使用的更多相关文章

  1. 【Git】 GitLab简单使用

    本例介绍简单实用GitLab,安装请参照[Git] GitLab服务器社区版安装与配置 1.用户和组的管理 a.创建组,在首页点击Create a group b.创建用户,在首页点击Add peop ...

  2. 使用git和gitlab进行协同开发流程

    一.基本概念 1.仓库(Repository) ①源仓库(线上版本库) 在项目的开始,项目的发起者构建起一个项目的最原始的仓库,称为origin. 源仓库的有两个作用: 1.汇总参与该项目的各个开发者 ...

  3. Git与GitLab

    Git与GitLab 一.Git Git是一个开源的分布式版本控制系统,用于敏捷高效地处理任何或小或大的项目. Git 是 Linus Torvalds 为了帮助管理 Linux 内核开发而开发的一个 ...

  4. win10下git与gitlab安装与文件上传

    目前了解到的版本管理工具有三种:gitlab  GitHub 和 码云 个人感觉 gitlab 在公司用的较多 便于协同办公   GitHub各种资源有很多,适合个人使用   码云是中文版 便于入门 ...

  5. Jenkins持续集成git、gitlab、sonarqube(7.0)、nexus,自动化部署实战,附安装包,严禁转载!!!

    导读 之前用的都是SVN,由于工作需要用到Git,求人不如求己,技多不压身,多学一项技能,未来就少求别人一次,系统的学一遍,自己搭建一整套环境,自动化部署(自动发版),代码质量检测等等(为啥不用doc ...

  6. docker中建立私有git服务器[gitlab]

    现在使用git的很普遍,在开发内部如何建立个git服务器,本文以gitlab为例,让你分分钟就可以搭好一个环境[docker的威力非同一般] 首先在docker.com找到gitlab的下载源和信息, ...

  7. centos7下搭建git和gitlab版本库

    系统:centos7 安装依赖: yum -y install curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl-d ...

  8. git服务器gitlab之搭建和使用--灰常好的git服务器【转】

    转自:http://blog.csdn.net/zy416548283/article/details/38057925 git服务器比较有名的是gitosis和gitolite,这两个管理和使用起来 ...

  9. 安装git,gitlab和TortoiseGit

    全部都是默认配置安装 需注册用户:用户名尽量好认 测试用户: 注册成功: 生成密钥: 1.首先使用TortoiseGit自带的Puttygen创建本地的公/私钥对 2.点击Generate按钮,在窗口 ...

随机推荐

  1. 什么是Js原型?(1)(包括作用:继承)

    学习目标:    认识什么js是原型,原型.构成函数.实例对象关系:原型应用范围. 什么是原型    函数有原型,函数有一个属性叫prototype,函数的这个原型指向一个对象,这个对象叫原型对象.这 ...

  2. Sentinel 1.7.0 发布,支持 Envoy 集群流量控制

    流控降级中间件Sentinel 1.7.0版本正式发布,引入了 Envoy 集群流量控制支持.properties 文件配置.Consul/Etcd/Spring Cloud Config 动态数据源 ...

  3. 在linux中 部署 mongo 数据库服务端

    1 首先需要一台linux服务器(我用的redhat linux,其它的也大同小异), 玩一玩的话,推荐亚马逊上面去创建一个免费的linux服务器,有关具体创建linux服务器不在这赘述. https ...

  4. BZOJ 1096: [ZJOI2007]仓库建设 动态规划 + 斜率优化

      #include<bits/stdc++.h> #define setIO(s) freopen(s".in","r",stdin) #defi ...

  5. 让VirtualBox虚拟机实现开机自动后台运行

    转至:http://www.cnblogs.com/top5/archive/2012/01/19/2326234.html 测试环境:Host OS: Windows 7 x64 Guest OS: ...

  6. pytest相关问题解析

    1. 如果你想查询在你的环境下有哪些pytest的active plugin可以使用: py.test --traceconfig 会得到一个扩展的头文件名显示激活的插件和他们的名字.同时也会打印出当 ...

  7. HDU 5634 Rikka with Phi

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5634 ------------------------------------------------ ...

  8. P1063能量项链

    传送 这又是一道经典的区间DP题. 复习一下区间DP的做法. 三重循环,第一层枚举区间长度,第二层枚举起点,第三层枚举断点. 区间长度是从1到n-1(因为如果是从1到n的话,1+n≠n,所以是1到n- ...

  9. linux使用apache发布静态html网页

    环境 centOS7+httpd 安装httpd 安装 #检查是否安装和httpd rpm -qa | grep httpd #如果没安装 yum -y install httpd 启动httpd并验 ...

  10. day18—Flex弹性布局详解(二)

    转行学开发,代码100天——2018-04-03 2.6 align-content属性 align-content 属性定义了在交叉轴方向对齐方式和额外空间分配,类似于justify-content ...