Gerrit 服务器入门使用-项目的创建与克隆
Gerrit 服务器入门使用-项目的创建与克隆
作者:尹正杰
版权声明:原创作品,谢绝转载!否则将追究法律责任。
一.创建克隆项目
1>.点击"BROWSE"

2>.点击"CREATE NEW"

3>.项目创建成功

二.基于HTTP方式克隆项目
1>.克隆项目
[gerrit@node201.yinzhengjie.org.cn ~]$
[gerrit@node201.yinzhengjie.org.cn ~]$ ll
total
drwxrwxr-x gerrit gerrit Jun : soft
[gerrit@node201.yinzhengjie.org.cn ~]$
[gerrit@node201.yinzhengjie.org.cn ~]$
[gerrit@node201.yinzhengjie.org.cn ~]$ git clone "http://172.30.1.201:8080/yinzhengjie-code"
Cloning into 'yinzhengjie-code'...
remote: Counting objects: , done
remote: Finding sources: % (/)
remote: Total (delta ), reused (delta )
Unpacking objects: % (/), done.
[gerrit@node201.yinzhengjie.org.cn ~]$
[gerrit@node201.yinzhengjie.org.cn ~]$ ll
total
drwxrwxr-x gerrit gerrit Jun : soft
drwxrwxr-x gerrit gerrit Jun : yinzhengjie-code
[gerrit@node201.yinzhengjie.org.cn ~]$
[gerrit@node201.yinzhengjie.org.cn ~]$ ll yinzhengjie-code/
total
[gerrit@node201.yinzhengjie.org.cn ~]$
[gerrit@node201.yinzhengjie.org.cn ~]$
2>.查看Gerrit的用户名

3>.在git上配置和Gerrit上存在的用户名和邮箱(要进入到已经克隆的项目中)
[gerrit@node201.yinzhengjie.org.cn ~]$ ll
total
drwxrwxr-x gerrit gerrit Jun : soft
drwxrwxr-x gerrit gerrit Jun : yinzhengjie-code
[gerrit@node201.yinzhengjie.org.cn ~]$ cd yinzhengjie-code/
[gerrit@node201.yinzhengjie.org.cn ~/yinzhengjie-code]$
[gerrit@node201.yinzhengjie.org.cn ~/yinzhengjie-code]$ git config user.name "jason"
[gerrit@node201.yinzhengjie.org.cn ~/yinzhengjie-code]$
[gerrit@node201.yinzhengjie.org.cn ~/yinzhengjie-code]$ git config user.email "y1053419035@qq.com"
[gerrit@node201.yinzhengjie.org.cn ~/yinzhengjie-code]$
4>.下载commit-msg
[gerrit@node201.yinzhengjie.org.cn ~/yinzhengjie-code]$ curl -Lo .git/hooks/commit-msg http://172.30.1.201:8080/tools/hooks/commit-msg
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
2119k --:--:-- --:--:-- --:--:-- 2334k
[gerrit@node201.yinzhengjie.org.cn ~/yinzhengjie-code]$
三.通过ssh方式克隆项目
1>.创建密钥
[root@node203.yinzhengjie.org.cn ~]# ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa
Generating public/private rsa key pair.
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:jjm9d783Ac7qfftXmgCPRmI6fJ/5yf74YHZSi4ofw7I root@node203.yinzhengjie.org.cn
The key's randomart image is:
+---[RSA ]----+
| |
| |
| |
| o o . |
| . oSo +o o |
| +=..o o= o.|
| +o+o+oB.ooo|
| . ==Oo*ooo|
| Eo+=*=*+*|
+----[SHA256]-----+
[root@node203.yinzhengjie.org.cn ~]#
2>.点击设置

3>.点击“SSH Keys”

4>.点击"SSH keys",将公钥拷贝到Gerrit上后点击"ADD NEW SSH KEY"

5>.公钥添加成功

6>.查看ssh的克隆命令

7>.使用ssh的方式克隆代码
[root@node203.yinzhengjie.org.cn ~]# ll
total
[root@node203.yinzhengjie.org.cn ~]#
[root@node203.yinzhengjie.org.cn ~]# git clone "ssh://jason@node201.yinzhengjie.org.cn:29418/yinzhengjie-code"
Cloning into 'yinzhengjie-code'...
The authenticity of host '[node201.yinzhengjie.org.cn]:29418 ([172.30.1.201]:29418)' can't be established.
ECDSA key fingerprint is SHA256:Mx8JcnxxxM/b99YiBG6+S8JP8Q12GNFYz0g/+YO4c0.
ECDSA key fingerprint is MD5:c0:2a:ae::::7b:fb::b3:e8:a5:d9:::6a.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[node201.yinzhengjie.org.cn]:29418,[172.30.1.201]:29418' (ECDSA) to the list of known hosts.
remote: Counting objects: , done
remote: Finding sources: % (/)
remote: Total (delta ), reused (delta )
Receiving objects: % (/), done.
[root@node203.yinzhengjie.org.cn ~]#
[root@node203.yinzhengjie.org.cn ~]# ll
total
drwxr-xr-x root root Jun : yinzhengjie-code
[root@node203.yinzhengjie.org.cn ~]#
[root@node203.yinzhengjie.org.cn ~]# ll yinzhengjie-code/
total
[root@node203.yinzhengjie.org.cn ~]#
[root@node203.yinzhengjie.org.cn ~]#
8>.使用另一种方式进行克隆
[root@node203.yinzhengjie.org.cn ~]# ssh -p jason@172.30.1.201 **** Welcome to Gerrit Code Review **** Hi jason, you have successfully connected over SSH. Unfortunately, interactive shells are disabled.
To clone a hosted Git repository, use: git clone ssh://jason@node201.yinzhengjie.org.cn:29418/REPOSITORY_NAME.git #我们根据提示,这种克隆方式也是ok的 Connection to 172.30.1.201 closed.
[root@node203.yinzhengjie.org.cn ~]#
Gerrit 服务器入门使用-项目的创建与克隆的更多相关文章
- WPF入门教程系列(一) 创建你的第一个WPF项目
WPF入门教程系列(一) 创建你的第一个WPF项目 WPF基础知识 快速学习绝不是从零学起的,良好的基础是快速入手的关键,下面先为大家摞列以下自己总结的学习WPF的几点基础知识: 1) C#基础语法知 ...
- 大数据入门:Maven项目的创建及相关配置
目录 Maven项目的创建及相关配置 一.Maven的介绍 1.Maven是什么: 2.Maven作用: 3.Maven项目的目录结构: 4.Maven的三点坐标: 5.maven的pom文件: 6. ...
- 【CuteJavaScript】Angular6入门项目(1.构建项目和创建路由)
本文目录 一.项目起步 二.编写路由组件 三.编写页面组件 1.编写单一组件 2.模拟数据 3.编写主从组件 四.编写服务 1.为什么需要服务 2.编写服务 五.引入RxJS 1.关于RxJS 2.引 ...
- Django---Http协议简述和原理,HTTP请求码,HTTP请求格式和响应格式(重点),Django的安装与使用,Django项目的创建和运行(cmd和pycharm两种模式),Django的基础文件配置,Web框架的本质,服务器程序和应用程序(wsgiref服务端模块,jinja2模板渲染模块)的使用
Django---Http协议简述和原理,HTTP请求码,HTTP请求格式和响应格式(重点),Django的安装与使用,Django项目的创建和运行(cmd和pycharm两种模式),Django的基 ...
- Cocos从入门到精通--《创建第一个项目:HelloWorld》
上节课我们解说了cocos2-x v3.7版本号的下载安装,也展示了使用CocosStudio编译不同平台运行程序的方法,大家是不是对新版本号的Cocos引擎充满期待?今天我们就创建一个project ...
- Gerrit服务器权限管理
Gerrit服务器权限管理 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.Gerrit权限概述 1>.对象 Gerrit识别单个或多个人员集合. Gerrit不允许使用单 ...
- Python编程:从入门到项目实践高清版附PDF百度网盘免费下载|Python入门编程免费领取
百度网盘:Python编程:从入门到项目实践高清版附PDF免费下载 提取码:oh2g 第一部分 基础知识第1章 起步 21.1 搭建编程环境 21.1.1 Python 2和Python 3 21 ...
- 如何搭建开源code review gerrit服务器
搭建环境:Ubuntu 14.04 一.环境准备 1.Java环境 gerrit依赖,用于安装gerrit环境. 下载:jdk-7u79-linux-x64.tar.gz http://www.ora ...
- Intellij Idea系列之JavaSE项目的创建(一)
Intellij Idea系列之JavaSE项目的创建(一) 一.Intellij Idea于 Intellij Idea是捷克的Jetbrain公司的一款优秀的针对Java程序员的IDE,其自从问世 ...
随机推荐
- Spring BeanFactory 初始化 和 Bean 生命周期
(version:spring-context-4.3.15.RELEASE) AbstractApplicationContext#refresh() public void refresh() t ...
- 初识内存挂:VirtualNES金手指教程
一.什么VirtualNES?什么是金手指? VirtualNES是一个NES模拟器,用来运行.nes文件,即在电脑上玩当年小霸王游戏机上的游戏.而它内置了一个简单的Cheat Engine,称之为金 ...
- python 根据生日计算年龄 sqlalchemy根据身份证号计算生日 性别
import datetime '): birth_d = datetime.datetime.strptime(birth_s, "%Y%m%d") today_d = date ...
- Docker实践之04-操作容器
目录 一.查看容器列表 二.启动容器 三.终止容器 四.重启容器 五.后台运行容器 六.获取容器输出信息 七.进入容器 八.导出和导入容器 九.删除容器 一.查看容器列表 可以使用命令docker c ...
- ETF计算公司:现金差额
T日现金差额=T日最小申赎单位的基金净值-(申购.赎回清单中必须现金替代的替代金额+申购.赎回清单中可以现金替代成份证券的数量与T日收盘价之和+申购.赎回清单中禁止现金替代成份证券的数量与T日收盘价之 ...
- vue-cli入门 - 搭建项目打包运行+webpack打包
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明.本文链接:https://blog.csdn.net/qq_38225558/article/d ...
- IntelliJ Idea 常用10款插件(提高开发效率)
出自:https://blog.csdn.net/weixin_41846320/article/details/82697818 插件安装方式: 1.Background Image Plus 这款 ...
- vim、vi 快捷键
普通模式 移动光标 nj.nk 上下移动n行 nb.nw 前后移动n个单词 nh.nl 左右移动n个字符 L 移到屏幕的最后一行 M 移到屏幕的中间一行 H 移到屏幕的第一行 nG 移到文件第n行 G ...
- 腾讯物联网操作系统正式开源,最小体积仅1.8 KB
9月18日,腾讯宣布将开源自主研发的轻量级物联网实时操作系统TencentOS tiny.相比市场上其它系统,腾讯TencentOS tiny在资源占用.设备成本.功耗管理以及安全稳定等层面极具竞争力 ...
- Python之路【第二十二篇】:轮播图片CSS
轮播代码如下: <!DOCTYPE html> <html lang="en"> <head> <meta charset="U ...