git服务器端安装
一、服务器端安装
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服务器端安装的更多相关文章
- window下版本控制工具Git 客户端安装
安装使用 1.下载msysgit http://code.google.com/p/msysgit/ 2.下载tortoisegit客户端安装 http://code.google.com/p/tor ...
- 分布式版本控制系统Git的安装及使用
Git的安装分为客户端安装和服务端安装,鉴于我平时码代码在windows环境下,因此本文客户端安装直接在windows环境,服务端安装在linux环境下(centos). Git客户端安装 客户端下载 ...
- git教程——安装配置
Git(读音为/gɪt/.)是一个开源的分布式版本控制系统,可以有效.高速的处理从很小到非常大的项目版本管理. Git 是 Linus Torvalds 为了帮助管理 Linux 内核开发而开发的一个 ...
- centos7下git服务器端搭建
git的安装: yum 源仓库里的 Git 版本更新不及时,最新版本的 Git 是 1.8.3.1,但是官方最新版本已经到了 2.9.2.想要安装最新版本的的 Git,只能下载源码进行安装. 1. 查 ...
- git从安装到使用
一.Git简介 Git是一个开源的分布式版本控制系统,用于敏捷高效地处理任何或小或大的项目. Git 是 Linus Torvalds 为了帮助管理 Linux 内核开发而开发的一个开放源码的版本控制 ...
- centos7下git服务器端搭建(转)
git的安装: yum 源仓库里的 Git 版本更新不及时,最新版本的 Git 是 1.8.3.1,但是官方最新版本已经到了 2.9.2.想要安装最新版本的的 Git,只能下载源码进行安装. 1. 查 ...
- eclipse的git插件安装、配置与使用
Git是一个分布式的版本控制工具,本篇文章从介绍Git开始,重点在于介绍Git的基本命令和使用技巧,让你尝试使用Git的同时,体验到原来一个版 本控制工具可以对开发产生如此之多的影响,文章分为两部分, ...
- centos7下git的安装和配置
git的安装: yum 源仓库里的 Git 版本更新不及时,最新版本的 Git 是 1.8.3.1,但是官方最新版本已经到了 2.9.2.想要安装最新版本的的 Git,只能下载源码进行安装. 1. 查 ...
- 1.windows下GIT 服务安装
本章介绍简单在windows 安装git 服务方法.服务器端采用的是Bonobo Git Server,一款用ASP.NET MVC开发的Git源代码管理工具,界面简洁,基于Web方式配置,简单易用. ...
随机推荐
- python iteration 迭代
可迭代的类型:list,tuple,dict,str,bytes,bytearray等 一.怎么判断一个对象是否可迭代 >>> from collections import Ite ...
- 自定义层or网络
目录 Outline keras.Sequential Layer/Model MyDense MyModel Outline keras.Sequential keras.layers.Layer ...
- [USACO10MAR]伟大的奶牛聚集Great Cow Gat…【树形dp】By cellur925
题目传送门 首先这道题是在树上进行的,然后求最小的不方便程度,比较符合dp的性质,那么我们就可以搞一搞树形dp. 设计状态:f[i]表示以i作为聚集地的最小不方便程度.那么我们还需要各点间的距离,但是 ...
- 递推DP HDOJ 5459 Jesus Is Here
题目传送门 题意:简单来说就是sn = sn-1 + sn-2递推而来,求其中所有c字符的:∑i<j:sn[i..i+2]=sn[j..j+2]=‘‘cff"(j−i) mod 530 ...
- Finally语句
- 502 IPO 上市
详见:https://leetcode.com/problems/ipo/description/ C++: class Solution { public: int findMaximizedCap ...
- Spring Boot整合Spring Batch
引言 Spring Batch是处理大量数据操作的一个框架,主要用来读取大量数据,然后进行一定的处理后输出指定的形式.比如我们可以将csv文件中的数据(数据量几百万甚至几千万都是没问题的)批处理插入保 ...
- subprocess模块详解2
1.call() 和run功能类似,都是接受一个列表里的参数. >>> import subprocess >>> a = subprocess.call([&qu ...
- BOM学习-javascript计时器小结
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content ...
- 伟景行 citymaker 从入门到精通(1)——js开发,最基本demo,加载cep工程文件
开发环境:citymaker 7(以下简称cm),jquery,easyui 1.4(界面),visual studio 2012(没有vs,不部署到IIS也行,html文件在本地目录双击打开可用) ...