一、服务器端安装

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. bzoj1179: [Apio2009]Atm 【缩点+spfa最长路】

    题目传送门 Description Siruseri 城中的道路都是单向的.不同的道路由路口连接.按照法律的规定, 在每个路口都设立了一个 Siruser i 银行的 ATM 取款机.令人奇怪的是,S ...

  2. 决斗(Headshot )

    #include<cstdio> #include<cstring> #include<algorithm> using namespace std; ; char ...

  3. Hdu 5446 Unknown Treasure (2015 ACM/ICPC Asia Regional Changchun Online Lucas定理 + 中国剩余定理)

    题目链接: Hdu 5446 Unknown Treasure 题目描述: 就是有n个苹果,要选出来m个,问有多少种选法?还有k个素数,p1,p2,p3,...pk,结果对lcm(p1,p2,p3.. ...

  4. [已读]编写高质量代码 改善JavaScript程序的188个建议

    吐槽一万遍,买的最后悔的一本,没有之一,大量篇幅抄袭<高性能javascript>,我记得还有部分抄袭<javascript精粹>,<javascript模式>有没 ...

  5. Backbone学习记录(5)

    数据与服务器 var User=Backbone.Model.extend({ defaults:{ name:'susan', age:18 }, url:'/user'//数据提交的路径 }); ...

  6. LVS集群-DR模式

    同上个实验一样,还是准备三台机器 分发器(sishen_63):eth0 192.168.1.63 RealServer1sishen_64) RealServer2sishen_65) 首先配置网卡 ...

  7. Android开发-浅谈架构(二)

    写在前面的话 我记得有一期罗胖的<罗辑思维>中他提到 我们在这个碎片化 充满焦虑的时代该怎么学习--用30%的时间 了解70%该领域的知识然后迅速转移芳草鲜美的地方 像游牧民族那样.原话应 ...

  8. P1179 数字统计

    题目描述 请统计某个给定范围[L, R]的所有整数中,数字 2 出现的次数. 比如给定范围[2, 22],数字 2 在数 2 中出现了 1 次,在数 12 中出现 1 次,在数 20 中出 现 1 次 ...

  9. VS配置本地IIS以域名访问

    1.IIS下配置自己的网站,添加主机名 2.修改hosts文件(C://Windows/System32/drivers/etc) 3.VS中配置项目Web服务器(选择外部主机)

  10. 上交oj1219 重要的逆序数对

    题意: https://acm.sjtu.edu.cn/OnlineJudge/problem/1219 思路: 在经典的归并排序求逆序数对算法基础上稍作修改. 实现: #include <io ...