zoukankan      html  css  js  c++  java
  • utils04_搭建私有Git服务器

    1.远程仓库实际上和本地仓库没啥不同,纯粹为了7x24小时开机并交换大家的修改。GitHub就是一个免费托管开源代码的远程仓库。但是对于某些视源代码如生命的商业公司来说,既不想公开源代码,又舍不得给GitHub交保护费,那就只能自己搭建一台Git服务器作为私有仓库使用。

    1、安装git服务环境准备

    yum -y install curl curl-devel zlib-devel openssl-devel perl cpio expat-devel gettext-devel gcc cc

    2、下载git-2.5.0.tar.gz

    1)解压缩

    2)cd git-2.5.0

    3)autoconf

    4)./configure

    5)make

    6)make install

    3、添加用户

    adduser -r -c 'git version control' -d /home/git -m git

    此命令执行后会创建/home/git目录作为git用户的主目录。

    5、设置密码

    passwd git

    输入两次密码

    6、切换到git用户

    su git

    7、创建git仓库

    git --bare init /home/git/first

    注意:如果不使用“--bare”参数,初始化仓库后,提交master分支时报错。这是由于git默认拒绝了push操作,需要.git/config添加如下代码:

    [receive]

          denyCurrentBranch = ignore

    推荐使用:git --bare init初始化仓库。

    本地连接私有仓库的方式:ssh://git@虚拟机ip地址/+私有仓库位置

     

  • 相关阅读:
    超图 wpf地图控件加载地图
    MySql常用内容
    超图资料下载与环境安装
    超图SampleCode运行须知
    英语感叹词
    英语之妻子,老婆
    Pycharm设置
    yizhihx ubuntu config
    Ubuntu之网易云音乐无法启动
    linux之错误输出重定向
  • 原文地址:https://www.cnblogs.com/asndxj/p/11656654.html
Copyright © 2011-2022 走看看