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,其自从问世 ...
随机推荐
- Ajax跨域请求附带Cookie/Ajax跨域请求附带身份凭证
一.跨域请求中默认不带cookie等验证凭证 尤其对于post请求. 对于ajax请求,其中post,get都可以正常访问. withCredentials: false, // 允许携带cookie ...
- 使用Mysql中的concat函数或正则匹配来快速批量生成用于执行的sql语句
背景介绍 今天需要给一张表里面补数据,需要按照行的维度进行update,如果是个别数据那么直接写update语句就可以了,但是场景要求的是将整表的数据进行update,要实现这个需求就不能只靠蛮力了, ...
- [转帖]50 亿美元!微软签下毕马威!JEDI 100 亿美元订单之后又一大单!
50 亿美元!微软签下毕马威!JEDI 100 亿美元订单之后又一大单! https://mp.weixin.qq.com/s/K0SrFNSVK5aOu6TIzhN92Q 前段时间,微软击败亚马逊, ...
- 前端中常见字节编码(base64、hex、utf8)及其转换
/* * 字节编码转换 * 首先都需要转为二级制数组 (ArrayBuffer) * 然后才能转换对应的编码字符 * 前端常见编码: * base64:就是将二进制转为字符串,将每6个字节转为一个特定 ...
- MyISAM 和 InnoDB 索引的区别
阅读目录 一 MyISAM索引实现 二 InnoDB索引实现 三 InnoDB索引和MyISAM索引的区别 回到顶部 一 MyISAM索引实现 1. 主键索引 MyISAM引擎使用B+树作为索引结 ...
- MATLAB 安装 cvx 工具箱
步骤: matlab本身是没有cvx的工具箱,需要到[cvx主页],「http://cvxr.com/cvx/」上下载,菜单上有个「download」,进入后选择适合你的版本下载: 将cvx压缩包解压 ...
- python requests 超时与重试
一 源起: requests模块作为python爬虫方向的基础模块实际上在日常实际工作中也会涉及到,比如用requests向对方接口url发送POST请求进行推送数据,使用GET请求拉取数据. 但是这 ...
- tensorflow-笔记02
TensorFlow扩展功能 自动求导.子图的执行.计算图控制流.队列/容器 1.TensorFlow自动求导 在深度学习乃至机器学习中,计算损失函数的梯度是最基本的需求,因此TensorFlow也原 ...
- sizeof运算符和strlen()函数
首先放上代码和运行结果.(在VC6.0上运行) #include<stdio.h> #include<string.h> int main(void) { char s1[]= ...
- C语言函数返回指针方法
1.将函数内部定义的变量用static修饰 由于static修饰的变量,分配在静态内存区(类似于全局变量区),函数返回时,并不会释放内存,因此可以将要返回的变量加static修饰. int *test ...