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


  • 相关阅读:
    Python学习笔记(四)多进程的使用
    Python学习笔记(三)多线程的使用
    windows无法安装msi文件
    标签传播算法
    信息论基础
    模块度Q
    HTTPS开发(SSL--用Tomcat服务器配置https双向认证)
    oracle 优化
    eclipse 界面开发--windowbuilder
    vba 读取数据库
  • 原文地址:https://www.cnblogs.com/aiwz/p/6333117.html
Copyright © 2011-2022 走看看