服务端(linux):

1. 安装git

[root@localhost ~]# yum -y install git

2. 增加一个git账户

为了管理的方便,在linux下面增添一个 "git" 账户。
[root@localhost git]# useradd git

3.创建一个git远程仓库

[root@localhost home]# mkdir -p data/git/gittest.git
[root@localhost home]# git init --bare data/git/gittest.git
Initialized empty Git repository in /home/data/git/gittest.git/
[root@localhost home]# cd data/git/
[root@localhost git]# chown -R git:git gittest.git/
注意:此时远程仓库已经建好了,这个仓库不能直接提取文件,只能通过clone的方式从里面下载文件,不能直接拿来用
 
 

客户端(linux)

1.然后在客户端从 Linux Git 服务器上 clone 项目:

$ git clone git@192.168.56.101:/home/data/git/gittest.git

如果SSH用的不是默认的22端口,则需要使用以下的命令(假设SSH端口号是7700):

$ git clone ssh://git@192.168.56.101:7700/home/data/git/gittest.git

上面git clone需要输入密码登录:如果想免密登录,需要把公钥拷贝一下

2.配置免密登录

ssh-keygen -t rsa 生成密钥文件,在root下生成了.ssh目录

ssh-copy-id -i ~/.ssh/id_rsa.pub  git@192.168.25.133   #你需要免密登录的用户跟IP

客户端:(windows):

参考文章:https://www.cnblogs.com/dee0912/p/5815267.html

在 Linux 下搭建 Git 服务器(yum安装)的更多相关文章

  1. 【转】在Linux下搭建Git服务器

    在 Linux 下搭建 Git 服务器 环境: 服务器 CentOS6.6 + git(version 1.7.1)客户端 Windows10 + git(version 2.8.4.windows. ...

  2. 在Linux下搭建Git服务器的方法是什么样?

    第一步 安装git:可以通过命令的方式快速安装,不同的linux的安装方法可能不一样,我的是采用的yum方法.ubuntu可以用apt-get命令.sudo yum install git 第二步 添 ...

  3. 在 Linux 下搭建 Git 服务器

    环境: 服务器 CentOS6.6 + git(version 1.7.1)客户端 Windows10 + git(version 2.8.4.windows.1) ① 安装 Git Linux 做为 ...

  4. 在Linux下搭建Git服务器步骤

    环境: 服务器 CentOS6.6 + git(version 1.7.1) 客户端 Windows10 + git(version 2.8.4.windows.1)  ① 安装 Git Linux ...

  5. Linux 下搭建Git 服务器详细步骤

    参考: https://www.cnblogs.com/dee0912/p/5815267.html#_label0 https://blog.csdn.net/carfge/article/deta ...

  6. Linux下搭建Git服务器

    1.安装Git 见 Jenkins持续集成环境部署 第四节 2.创建Git用户和用户组 groupadd git useradd git -g git 3.创建证书切换到git用户创建证书 su gi ...

  7. kali linux 下搭建git服务器

    参考:http://www.cnblogs.com/dee0912/p/5815267.html https://www.liaoxuefeng.com/wiki/001373951630592960 ...

  8. 在Linux下搭建git服务器

    http://www.cnblogs.com/dee0912/p/5815267.html 步骤很详细,很受用

  9. Windows下搭建Git 服务器: BONOBO GIT SERVER + TortoiseGit

    本文将介绍如何在Windows操作系统下搭建Git服务器和客户端.服务器端采用的是Bonobo Git Server,一款用ASP.NET MVC开发的Git源代码管理工具,界面简洁,基于Web方式配 ...

随机推荐

  1. js实现栈结构

    实现栈结构 //创建栈 function Stack (){ let items = [] this.push = function(element){ items.push(element) } t ...

  2. 2806 红与黑 个人博客:doubleq.win

    个人博客:doubleq.win 2806 红与黑  时间限制: 1 s  空间限制: 64000 KB  题目等级 : 白银 Silver 题解  查看运行结果     题目描述 Descripti ...

  3. 13 Reasons Why You Should Pay Attention to Mobile Web Performance

    Mobile is no longer on the sidelines. If you’re not already thinking mobile first, you should at lea ...

  4. 《Linux命令行与Shell脚本编程大全第2版》读书笔记

    公司说不准用云笔记了,吓得我赶紧把笔记贴到博客上先..... 近3年前的了,只有一半的章节,后面的没空记录了.... 第1章 可以cat /proc/meminfo文件来观察Linux系统上虚拟内存的 ...

  5. Class.forName和ClassLoader.loadClass的区别(转载)

    Class的装载分了三个阶段,loading,linking和initializing,分别定义在The Java Language Specification的12.2,12.3和12.4.Clas ...

  6. GNU工具 ar

    1.ar基本用法 ar命令可以用来创建.修改库,也可以从库中提出单个模块.库是一单独的文件,里面包含了按照特定的结构组织起来的其它的一些文件(称做此库文件的member).原始文件的内容.模式.时间戳 ...

  7. Visual Studio解决方案vs2005/vs2008/vs2010/vs2012/vs2013/vs2015版本互相转换工具

    原文:http://blog.csdn.net/xiejiashu/article/details/52397641   本文转自EasyDarwin团队成员Alex的博客:http://blog.c ...

  8. 常用到的简单命令 Sublime Git NPM WindowsCMD MacTerminal(Unix命令) Vim

    sublime 选择标签及其内容 ctrl+shift+a连续按两次 调出Package console: Mac: command + shift + p 安装插件: 1.调出 Package co ...

  9. elasticsearch集群搭建报错: not enough master nodes discovered during pinging

    自己用一台 阿里云 服务器 搭建ES集群的时候,总是报上面的问题. 而且两个ES服务都是报同样的问题.自己的配置文件如下: es服务1配置文件 cluster.name: elasticsearch ...

  10. tomcat优化记录

    1.使用jdk自带的Jconsole进行可视化查看: 2.使用jmeter做压力测试,做完后有几个重要的指标:正确率.cpu占用率.qps jvm: 3.tomcat server.xml优化: ar ...