一、服务器端安装

git支持四种传输协议

1.本地协议

2.ssh协议

3.git协议

4.http/s协议

[root@zabbix ~]# cat /etc/redhat-release
CentOS Linux release  (Core)
[root@zabbix ~]# uname -r
-.el7.x86_64
[root@zabbix ~]# rpm -qa git
git-.el7.x86_64
[root@zabbix ~]# yum remove git
[root@zabbix ~]# yum install gcc gcc-c++ -y

[root@zabbix ~]# yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel  perl-ExtUtils-MakeMaker -y

[root@zabbix ~]# mkdir -p /server/tools
[root@zabbix ~]# cd /server/tools/
[root@zabbix tools]# wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.9.0.tar.gz
[root@zabbix tools]# tar xf git-2.9.0.tar.gz
[root@zabbix tools]# cd git-2.9.0
[root@zabbix git-2.9.0]# make prefix=/application/git
[root@zabbix git-2.9.0]# make prefix=/application/git install
[root@zabbix git]# echo 'export PATH=/application/git/bin:$PATH' >>/etc/profile
[root@zabbix git]# source /etc/profile
[root@zabbix bin]# git --version
git version 2.9.0######测试以原来的git客户端,作为服务器端,这里将原有的仓库,导出为裸仓库,如果是客户端,导为裸仓库后,转移到服务器端即可[root@zabbix data]# ls      test            #####test为现有仓库[root@zabbix data]# ls -a test/.  ..  1  2  3  4  .git[root@zabbix data]# git clone --bare test test.git      #####将现有仓库导出为裸仓库----即不包含工作目录的仓库克隆到纯仓库 'test.git'...完成。[root@zabbix data]# ls -a test.git/          #####裸仓库内容.  ..  branches  config  description  HEAD  hooks  info  objects  packed-refs  refs[root@zabbix data]# mkdir 111[root@zabbix data]# git clone /data/test.gitfatal: 目标路径 'test' 已经存在,并且不是一个空目录。[root@zabbix data]# cd 111[root@zabbix 111]# git clone /data/test.git    #####测试,新建一个目录,克隆刚刚导出的裸仓库,与原来仓库的内容相同正克隆到 'test'...完成。[root@zabbix 111]# ll test/ -a总用量 0drwxr-xr-x. 3 root root  54 6月  27 16:02 .drwxr-xr-x. 3 root root  18 6月  27 16:02 ..-rw-r--r--. 1 root root   0 6月  27 16:02 1-rw-r--r--. 1 root root   0 6月  27 16:02 2-rw-r--r--. 1 root root   0 6月  27 16:02 3-rw-r--r--. 1 root root   0 6月  27 16:02 4drwxr-xr-x. 8 root root 163 6月  27 16:02 .git

######使用ssh协议客户端[root@zabbixclient ~]# ssh-keygen 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:5c:a1:ed:50:8c:da:05:43:8e:d6:5d:08:95:5d:c2:4f root@zabbixclient.suffergtf.comThe key's randomart image is:+--[ RSA 2048]----+|       .=*+=o..  ||       +.*=oo.E  ||      oo=.+  o   ||     ....+    .  ||        S .      ||                 ||                 ||                 ||                 |+-----------------+[root@zabbixclient ~]# ssh-copy-id root@192.168.127.250The authenticity of host '192.168.127.250 (192.168.127.250)' can't be established.ECDSA key fingerprint is e5:07:2a:f0:9f:c5:df:64:70:61:6a:7a:31:bf:21:7a.Are you sure you want to continue connecting (yes/no)? /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installedThe authenticity of host '192.168.127.250 (192.168.127.250)' can't be established.ECDSA key fingerprint is e5:07:2a:f0:9f:c5:df:64:70:61:6a:7a:31:bf:21:7a.Are you sure you want to continue connecting (yes/no)? yes/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keysroot@192.168.127.250's password: 

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh 'root@192.168.127.250'"and check to make sure that only the key(s) you wanted were added.

[root@zabbixclient ~]# ssh root@192.168.127.250      ####免密码登陆Last login: Mon Jul  9 15:21:26 2018 from 192.168.127.251

[root@zabbixclient data]# git clone root@192.168.127.250:/data/test.git      ####克隆远程仓库正克隆到 'test'...remote: Counting objects: 16, done.remote: Compressing objects: 100% (12/12), done.remote: Total 16 (delta 6), reused 0 (delta 0)接收对象中: 100% (16/16), done.处理 delta 中: 100% (6/6), done.[root@zabbixclient data]# lstest[root@zabbixclient data]# cd test[root@zabbixclient test]# git status# 位于分支 master无文件要提交,干净的工作区

git服务器端安装的更多相关文章

  1. window下版本控制工具Git 客户端安装

    安装使用 1.下载msysgit http://code.google.com/p/msysgit/ 2.下载tortoisegit客户端安装 http://code.google.com/p/tor ...

  2. 分布式版本控制系统Git的安装及使用

    Git的安装分为客户端安装和服务端安装,鉴于我平时码代码在windows环境下,因此本文客户端安装直接在windows环境,服务端安装在linux环境下(centos). Git客户端安装 客户端下载 ...

  3. git教程——安装配置

    Git(读音为/gɪt/.)是一个开源的分布式版本控制系统,可以有效.高速的处理从很小到非常大的项目版本管理. Git 是 Linus Torvalds 为了帮助管理 Linux 内核开发而开发的一个 ...

  4. centos7下git服务器端搭建

    git的安装: yum 源仓库里的 Git 版本更新不及时,最新版本的 Git 是 1.8.3.1,但是官方最新版本已经到了 2.9.2.想要安装最新版本的的 Git,只能下载源码进行安装. 1. 查 ...

  5. git从安装到使用

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

  6. centos7下git服务器端搭建(转)

    git的安装: yum 源仓库里的 Git 版本更新不及时,最新版本的 Git 是 1.8.3.1,但是官方最新版本已经到了 2.9.2.想要安装最新版本的的 Git,只能下载源码进行安装. 1. 查 ...

  7. eclipse的git插件安装、配置与使用

    Git是一个分布式的版本控制工具,本篇文章从介绍Git开始,重点在于介绍Git的基本命令和使用技巧,让你尝试使用Git的同时,体验到原来一个版 本控制工具可以对开发产生如此之多的影响,文章分为两部分, ...

  8. centos7下git的安装和配置

    git的安装: yum 源仓库里的 Git 版本更新不及时,最新版本的 Git 是 1.8.3.1,但是官方最新版本已经到了 2.9.2.想要安装最新版本的的 Git,只能下载源码进行安装. 1. 查 ...

  9. 1.windows下GIT 服务安装

    本章介绍简单在windows 安装git 服务方法.服务器端采用的是Bonobo Git Server,一款用ASP.NET MVC开发的Git源代码管理工具,界面简洁,基于Web方式配置,简单易用. ...

随机推荐

  1. Luogu P1607 庙会班车【线段树】By cellur925

    题目传送门 据说可以用贪心做?算了算了...我都不会贪.... 开始想的是用线段树,先建出一颗空树,然后输进区间操作后就维护最大值,显然开始我忽视了班车的容量以及可以有多组奶牛坐在一起的信息. 我们肯 ...

  2. elasticsearch 查询 query

    对于 类型是 text的字段,并且分析器指明是ik_max_word的会建立倒排索引 查询的分类: match查询:  会自动转换大小写,会分词, term查询: 不会转换和分词,只能值匹配 term ...

  3. Asp.net WebApi 异常处理解决方案

    一.使用异常筛选器捕获所有异常 我们知道,一般情况下,WebApi作为服务使用,每次客户端发送http请求到我们的WebApi服务里面,服务端得到结果输出response到客户端.这个过程中,一旦服务 ...

  4. 【loj10061】最短母串

    #10061. 「一本通 2.4 练习 4」最短母串 内存限制:512 MiB 时间限制:1000 ms 标准输入输出 题目类型:传统 评测方式:文本比较 上传者: 1bentong 提交    提交 ...

  5. Backbone学习记录(6)

    路由 backbone将路由规则和一个方法名绑定到一起,来控制单页的hash,以及单页的前进后退. var UserRouter = Backbone.Router.extend({ routes: ...

  6. .NET Core WebAPI Swagger使用

    相对于普通的webapi而言,.net core webapi本身并不具备文档的功能,所以可以借助第三方插件:swagger,使用的话很简单. 步骤一. Nuget Packages安装,使用程序包管 ...

  7. Web版简易五子棋

    前些时候把大三写的C++版五子棋改成Web板挂到了网上,具有一定傻瓜式智能,欢迎体验使用拍砖:http://www.zhentiyuan.com/Games/QuickFiveChess.aspx 现 ...

  8. 【学习笔记】OSG中相机参数的更改

    #pragma comment(lib, "osg.lib") #pragma comment(lib, "osgDB.lib") #pragma commen ...

  9. 通过HA方式操作HDFS

    之前操作hdfs的时候,都是固定namenode的地址,然后去操作.这个时候就必须判断namenode的状态为active还是standby,比较繁琐,如果集群使用了HA的形式,就很方便了 直接上代码 ...

  10. QWidget标题栏双击事件

    widget.h virtual bool event(QEvent *event); widget.cpp bool Widget::event(QEvent *event) { if (event ...