git服务器配置

git服务器http配置

1,配置apache服务器(假定目录在gitFile)

2,终端执行

cd ~/local/gitFile *定位至apache目录

mkdir myproject.git

cd myproject.git

git init --bare *创建仓库

完成以上步骤可以在浏览器中访问http://localhost/\~username/gitFile/Myproject.git/

可以查看到git的一些文件(head branches info等)

3,终端执行

cd ~/local/gitFile/myproject.git

mv hooks/post-update.sample hooks/post-update

a+x hooks/post-update

./hooks/post-update

完成以上步骤可以在终端中测试git仓库是否创建成功

终端执行git clone http://localhost/\~username/gitFile/Myproject.git/ 查看是否创建成功(一步步来肯定是成功的哈)

4,此时git还不具备commit权限

在 etc/extra/conf/httpd.conf 中取消#Include conf/extra/httpd-dav.conf 中的#

在conf/extra/httpd-dav.conf中修改

DavLockDB "/usr/var/DavLock"

Alias /git "/usr/fileGit"

Alias /uploads "/usr/uploads"

<Directory "/usr/fileGit">

Dav On

Options +Indexes +FollowSymLinks

AllowOverride None

Order Allow,Deny

Allow from all

AuthType Basic

AuthName "Git"

AuthUserFile "user/user.git"

Require valid-user

</Directory>

5,http配置完成了。

相关推荐
嘻嘻仙人2 天前
Ubuntu中 git上传自己的项目和二次上传一般流程
git·github
Patrick_Wilson2 天前
Squash Merge 的血缘陷阱:为什么删掉的代码又活了过来
前端·git·程序员
沉浸学习的匿名网友2 天前
什么是 .gitignore?为什么每个 Git 项目几乎都离不开它?
前端·git
Goodbye3 天前
大模型无状态架构:从 HTTP 协议到 Harness AI 工程的深度解析
http
深海鱼在掘金3 天前
Git 完全指南 —— 第3章:理解工作区、暂存区、版本库三个核心
git
江华森3 天前
Git 基础筑基:从原理到团队协作的全栈实战
git
JakeJiang3 天前
Git 必备命令指南:从日常高频到项目开发实战
git
叫我少年4 天前
Windows 中安装 git
git
霜落长河9 天前
抛弃TCP改用UDP,HTTP3怎么了?
http
深海鱼在掘金9 天前
Git 完全指南 —— 第1章:Git 概览与版本控制演进
git