1.初始化库
git init --bare wap.git
2.配置wap.git/config文件
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
worktree = /data1/project/admin
[receive]
denycurrentbranch = ignore
3.新建钩子wap.git/hooks/post-receive
#!/bin/bash
echo "===> start to Synchronization code"
git --work-tree=/data1/project/wap checkout -f
4.把新建的wap.git赋予全部权限为git用户账号
chown git.git wap.git/ -R
5.新建部署代码的目录并赋予git用户账号权限
mkdir /data1/project/wap
chown git.git /data1/project/wap/
6.使用git用户账号@url:wap.git即可clone项目
git clone git用户账号@url:wap.git
原文地址:https://www.cnblogs.com/phonecom/p/10704790.html
时间: 2024-10-16 20:14:31