Gerrit 服务器入门使用-项目的创建与克隆

                                     作者:尹正杰

版权声明:原创作品,谢绝转载!否则将追究法律责任。

一.创建克隆项目

1>.点击"BROWSE"

2>.点击"CREATE NEW"

3>.项目创建成功

二.基于HTTP方式克隆项目

1>.克隆项目

  1. [gerrit@node201.yinzhengjie.org.cn ~]$
  2. [gerrit@node201.yinzhengjie.org.cn ~]$ ll
  3. total
  4. drwxrwxr-x gerrit gerrit Jun : soft
  5. [gerrit@node201.yinzhengjie.org.cn ~]$
  6. [gerrit@node201.yinzhengjie.org.cn ~]$
  7. [gerrit@node201.yinzhengjie.org.cn ~]$ git clone "http://172.30.1.201:8080/yinzhengjie-code"
  8. Cloning into 'yinzhengjie-code'...
  9. remote: Counting objects: , done
  10. remote: Finding sources: % (/)
  11. remote: Total (delta ), reused (delta )
  12. Unpacking objects: % (/), done.
  13. [gerrit@node201.yinzhengjie.org.cn ~]$
  14. [gerrit@node201.yinzhengjie.org.cn ~]$ ll
  15. total
  16. drwxrwxr-x gerrit gerrit Jun : soft
  17. drwxrwxr-x gerrit gerrit Jun : yinzhengjie-code
  18. [gerrit@node201.yinzhengjie.org.cn ~]$
  19. [gerrit@node201.yinzhengjie.org.cn ~]$ ll yinzhengjie-code/
  20. total
  21. [gerrit@node201.yinzhengjie.org.cn ~]$
  22. [gerrit@node201.yinzhengjie.org.cn ~]$

2>.查看Gerrit的用户名

3>.在git上配置和Gerrit上存在的用户名和邮箱(要进入到已经克隆的项目中)

  1. [gerrit@node201.yinzhengjie.org.cn ~]$ ll
  2. total
  3. drwxrwxr-x gerrit gerrit Jun : soft
  4. drwxrwxr-x gerrit gerrit Jun : yinzhengjie-code
  5. [gerrit@node201.yinzhengjie.org.cn ~]$ cd yinzhengjie-code/
  6. [gerrit@node201.yinzhengjie.org.cn ~/yinzhengjie-code]$
  7. [gerrit@node201.yinzhengjie.org.cn ~/yinzhengjie-code]$ git config user.name "jason"
  8. [gerrit@node201.yinzhengjie.org.cn ~/yinzhengjie-code]$
  9. [gerrit@node201.yinzhengjie.org.cn ~/yinzhengjie-code]$ git config user.email "y1053419035@qq.com"
  10. [gerrit@node201.yinzhengjie.org.cn ~/yinzhengjie-code]$

4>.下载commit-msg

  1. [gerrit@node201.yinzhengjie.org.cn ~/yinzhengjie-code]$ curl -Lo .git/hooks/commit-msg http://172.30.1.201:8080/tools/hooks/commit-msg
  2. % Total % Received % Xferd Average Speed Time Time Time Current
  3. Dload Upload Total Spent Left Speed
  4. 2119k --:--:-- --:--:-- --:--:-- 2334k
  5. [gerrit@node201.yinzhengjie.org.cn ~/yinzhengjie-code]$

三.通过ssh方式克隆项目

1>.创建密钥

  1. [root@node203.yinzhengjie.org.cn ~]# ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa
  2. Generating public/private rsa key pair.
  3. Your identification has been saved in /root/.ssh/id_rsa.
  4. Your public key has been saved in /root/.ssh/id_rsa.pub.
  5. The key fingerprint is:
  6. SHA256:jjm9d783Ac7qfftXmgCPRmI6fJ/5yf74YHZSi4ofw7I root@node203.yinzhengjie.org.cn
  7. The key's randomart image is:
  8. +---[RSA ]----+
  9. | |
  10. | |
  11. | |
  12. | o o . |
  13. | . oSo +o o |
  14. | +=..o o= o.|
  15. | +o+o+oB.ooo|
  16. | . ==Oo*ooo|
  17. | Eo+=*=*+*|
  18. +----[SHA256]-----+
  19. [root@node203.yinzhengjie.org.cn ~]#

2>.点击设置

3>.点击“SSH Keys”

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

5>.公钥添加成功

6>.查看ssh的克隆命令

7>.使用ssh的方式克隆代码

  1. [root@node203.yinzhengjie.org.cn ~]# ll
  2. total
  3. [root@node203.yinzhengjie.org.cn ~]#
  4. [root@node203.yinzhengjie.org.cn ~]# git clone "ssh://jason@node201.yinzhengjie.org.cn:29418/yinzhengjie-code"
  5. Cloning into 'yinzhengjie-code'...
  6. The authenticity of host '[node201.yinzhengjie.org.cn]:29418 ([172.30.1.201]:29418)' can't be established.
  7. ECDSA key fingerprint is SHA256:Mx8JcnxxxM/b99YiBG6+S8JP8Q12GNFYz0g/+YO4c0.
  8. ECDSA key fingerprint is MD5:c0:2a:ae::::7b:fb::b3:e8:a5:d9:::6a.
  9. Are you sure you want to continue connecting (yes/no)? yes
  10. Warning: Permanently added '[node201.yinzhengjie.org.cn]:29418,[172.30.1.201]:29418' (ECDSA) to the list of known hosts.
  11. remote: Counting objects: , done
  12. remote: Finding sources: % (/)
  13. remote: Total (delta ), reused (delta )
  14. Receiving objects: % (/), done.
  15. [root@node203.yinzhengjie.org.cn ~]#
  16. [root@node203.yinzhengjie.org.cn ~]# ll
  17. total
  18. drwxr-xr-x root root Jun : yinzhengjie-code
  19. [root@node203.yinzhengjie.org.cn ~]#
  20. [root@node203.yinzhengjie.org.cn ~]# ll yinzhengjie-code/
  21. total
  22. [root@node203.yinzhengjie.org.cn ~]#
  23. [root@node203.yinzhengjie.org.cn ~]#

8>.使用另一种方式进行克隆

  1. [root@node203.yinzhengjie.org.cn ~]# ssh -p jason@172.30.1.201
  2.  
  3. **** Welcome to Gerrit Code Review ****
  4.  
  5. Hi jason, you have successfully connected over SSH.
  6.  
  7. Unfortunately, interactive shells are disabled.
  8. To clone a hosted Git repository, use:
  9.  
  10. git clone ssh://jason@node201.yinzhengjie.org.cn:29418/REPOSITORY_NAME.git        #我们根据提示,这种克隆方式也是ok的
  11.  
  12. Connection to 172.30.1.201 closed.
  13. [root@node203.yinzhengjie.org.cn ~]#

Gerrit 服务器入门使用-项目的创建与克隆的更多相关文章

  1. WPF入门教程系列(一) 创建你的第一个WPF项目

    WPF入门教程系列(一) 创建你的第一个WPF项目 WPF基础知识 快速学习绝不是从零学起的,良好的基础是快速入手的关键,下面先为大家摞列以下自己总结的学习WPF的几点基础知识: 1) C#基础语法知 ...

  2. 大数据入门:Maven项目的创建及相关配置

    目录 Maven项目的创建及相关配置 一.Maven的介绍 1.Maven是什么: 2.Maven作用: 3.Maven项目的目录结构: 4.Maven的三点坐标: 5.maven的pom文件: 6. ...

  3. 【CuteJavaScript】Angular6入门项目(1.构建项目和创建路由)

    本文目录 一.项目起步 二.编写路由组件 三.编写页面组件 1.编写单一组件 2.模拟数据 3.编写主从组件 四.编写服务 1.为什么需要服务 2.编写服务 五.引入RxJS 1.关于RxJS 2.引 ...

  4. Django---Http协议简述和原理,HTTP请求码,HTTP请求格式和响应格式(重点),Django的安装与使用,Django项目的创建和运行(cmd和pycharm两种模式),Django的基础文件配置,Web框架的本质,服务器程序和应用程序(wsgiref服务端模块,jinja2模板渲染模块)的使用

    Django---Http协议简述和原理,HTTP请求码,HTTP请求格式和响应格式(重点),Django的安装与使用,Django项目的创建和运行(cmd和pycharm两种模式),Django的基 ...

  5. Cocos从入门到精通--《创建第一个项目:HelloWorld》

    上节课我们解说了cocos2-x v3.7版本号的下载安装,也展示了使用CocosStudio编译不同平台运行程序的方法,大家是不是对新版本号的Cocos引擎充满期待?今天我们就创建一个project ...

  6. Gerrit服务器权限管理

    Gerrit服务器权限管理 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.Gerrit权限概述 1>.对象 Gerrit识别单个或多个人员集合. Gerrit不允许使用单 ...

  7. Python编程:从入门到项目实践高清版附PDF百度网盘免费下载|Python入门编程免费领取

    百度网盘:Python编程:从入门到项目实践高清版附PDF免费下载 提取码:oh2g   第一部分 基础知识第1章 起步 21.1 搭建编程环境 21.1.1 Python 2和Python 3 21 ...

  8. 如何搭建开源code review gerrit服务器

    搭建环境:Ubuntu 14.04 一.环境准备 1.Java环境 gerrit依赖,用于安装gerrit环境. 下载:jdk-7u79-linux-x64.tar.gz http://www.ora ...

  9. Intellij Idea系列之JavaSE项目的创建(一)

    Intellij Idea系列之JavaSE项目的创建(一) 一.Intellij Idea于 Intellij Idea是捷克的Jetbrain公司的一款优秀的针对Java程序员的IDE,其自从问世 ...

随机推荐

  1. 人脸识别(基于ArcFace)

    我们先来看看效果 上面是根据图片检测出其中的人脸.每个人脸的年龄还有性别,非常强大 第一步: 登录https://ai.arcsoft.com.cn/,注册开发者账号,身份认证,注册应用,得到APPI ...

  2. Nginx打印json日志

    1.修改配置,在http{}中添加 log_format access_json '{"@timestamp":"$time_iso8601",' '" ...

  3. docker 国内镜像加速

    CentOS7 对于使用 systemd 的系统,请在 /etc/docker/daemon.json 中写入如下内容(如果文件不存在请新建该文件): {"registry-mirrors& ...

  4. typescript导入图片报找不到模块的错误

    https://www.cnblogs.com/chen-cong/p/10445635.html images.d.ts: declare module '*.svg' declare module ...

  5. 如何录制高清GIF格式的图片

    如何录制高清GIF格式的图片 工具:傲软GIF 下载地址:https://www.apowersoft.cn/gif 特点:质量高,能够一帧一帧的修改 使用简单.就不说了.自行尝试.这里只是提供一个制 ...

  6. PHP7之Trait详解

    转自: https://www.jianshu.com/p/fc053b2d7fd1 php从以前到现在一直都是单继承的语言,无法同时从两个基类中继承属性和方法,为了解决这个问题,php出了Trait ...

  7. nginx 进程问题

    1 nginx的进程分为四种 master worker cacheLoader cacheManager. 实际接收请求的进程是 worker,master监控worker节点,之所以会多进程模式, ...

  8. Delphi TButton.OnClick 匿名函数用法

    type TNotifyEventRef = reference to procedure(Sender: TObject); function AnonymousEvent(const Proc: ...

  9. Vue框架——页面组件中使用小组件

    小组件在components文件夹中,页面组件在views文件夹中 一.先写小组件的vue,比如text.vue(在template设置模板渲染,style设置样式) <template> ...

  10. 查看Linux服务器配置

    1.查看CPU lscpu 2.查看内存 free -g 或 free -m 3.查看硬盘 df -h