webhooks整理
码云创建远程仓库
生成公钥

服务器配置webhooks

#!/bin/bash
echo ""
#输出当前时间
date --date='0 days ago' "+%Y-%m-%d %H:%M:%S"
echo "Start"
#git项目路径
gitPath="/www/wwwroot/XJ/FastAdmin/51fa/"
#git 网址
gitHttp="https://gitee.com/duosheng_network/51fa.git"

echo "Web站点路径:$gitPath"
echo "上传人:$1"

#判断项目路径是否存在
if [ -d "$gitPath" ]; then
cd $gitPath
#判断是否存在git目录
if [ ! -d ".git" ]; then
echo "在该目录下克隆 git"
git clone $gitHttp gittemp
mv gittemp/.git .
rm -rf gittemp
fi
#拉取最新的项目文件
git reset --hard origin/master
git pull
#设置目录权限
chown -R www:www $gitPath
echo "End"
exit
else
echo "该项目路径不存在"
echo "End"
exit
fi

gitpath路径中应有.git

本地配置git
设置并连接git仓库

最新文章

  1. mysql一些有用的链接
  2. 开发环境中biztalk项目设置注意事项(转)
  3. POJ 2002 Squares
  4. AD转换精度的计算
  5. Git 常用操作。
  6. HDU5046 Airport dancing links 重复覆盖+二分
  7. Conditionals with Omitted Operands (x ? : y)
  8. JVM内存管理及垃圾回收
  9. shell,python获取当前路径(脚本的当前路径) (aso项目记录)
  10. JavaScript常用数组操作方法,包含ES6方法
  11. (string stoi 栈)leetcode682. Baseball Game
  12. protobuf 动态创建
  13. SerialPort.h SerialPort.cpp
  14. 如何启动Intel VT-X及合理利用搜索
  15. PostgreSQL之连接数修改
  16. CSUOJ 1170 A sample problem
  17. Android——黑名单管理
  18. Inversion of Control Containers and the Dependency Injection pattern
  19. javabean的内省技术和BeanUtils的使用
  20. PHP汉字转拼音

热门文章

  1. 【原】eclipse连接数据库开发web项目
  2. 配置Multipath多路径环境
  3. ansible变量定义
  4. keras基于卷积网络手写数字识别
  5. swagger2 常用注解说明
  6. Javascript调试技巧整理
  7. python-matplotlib-ERROR
  8. BZOJ1718分离的路径
  9. 学习笔记01:《开放平台产品成长之路-POP》
  10. PHP AJAX 返回JSON 数据