zoukankan      html  css  js  c++  java
  • 配置Windows下的Git 服务器简易教程

    • 下载

    msysGit

    TortoiseGit

    WampServer2

    • 配置Git

                 cd C:\Program Files\Git\libexec\git-core
                 copy C:\Program Files\Git\bin\libiconv-2.dll           
                 git-http-backend.exe 

    • 配置Apache

    修改httpd.conf :

    <directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Allow from all
    </directory>
    


    在 httpd.conf 文件末尾追加:

    # Set this to the root folder containing your Git repositories.
    SetEnv GIT_PROJECT_ROOT E:/SvnServer
    # Set this to export all projects by default (by default,
    # git will only publish those repositories that contain a
    # file named “git-daemon-export-ok”
    SetEnv GIT_HTTP_EXPORT_ALL 1
    # Route specific URLS matching this regular expression to the git http server.
    ScriptAliasMatch \
    “(?x)^/git/(.*/(HEAD | \
    info/refs | \
    objects/(info/[^/]+ | \
    [0-9a-f]{2}/[0-9a-f]{38} | \
    pack/pack-[0-9a-f]{40}\.(pack|idx)) | \
    git-(upload|receive)-pack))$” \
    “C:/Program Files/Git/libexec/git-core/git-http-backend.exe/$1″
     
    <Location />
    AuthType Basic
    AuthName “GIT Server
    AuthUserFile “E:/SvnServer/htpassword”
    Require valid-user
    </Location>



    • 添加用户

    切换到 Apache 安装目录下的 bin目录

    htpasswd -cmb E:/SvnServer/htpassword mythma 123456


    • 创建代码仓库


    cd E:\GitServer
    git init --bare mythma.git
    git update-server-info
    



    • 客户端

    使用TortoiseGit clone

    git add .

    git commit -m "Add"

    git push origin master


  • 相关阅读:
    最值得你学习的编程语言
    【收藏】程序员的资料库--技术文档、视频教程、电子书
    pig 安装
    MySQL导入.sql文件及常用命令
    win7下使用 EasyBCD 硬盘安装centOS
    Linux系统分区
    Hadoop实战教程视频
    中医药小分子和表观遗传重编程
    OpenSSL
    iOS 判断网络连接状态之重写Reachability
  • 原文地址:https://www.cnblogs.com/aiwz/p/6333117.html
Copyright © 2011-2022 走看看