Q:

最近配了个服务器,用的GIT,本地提交后服务器必须再拉取一下才能更新出来。。求个提交后自动更新的方法

A:

最佳工具 git hook 

post-update.sample 改名为post-update

然后加几行简单的代码就能实现你的需求了

例:

gitdir=/****

cd $gitdir

git checkout 对应分支

git pull

end...

-------------------------------------

最简单的办法就是服务器上用一个cron任务,定时拉取。

---------------------------------------

利用git的hook,在hook里对应的事件中写shell脚本

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
  • 2021-11-05
  • 2022-02-20
  • 2022-12-23
  • 2022-12-23
  • 2021-12-01
猜你喜欢
  • 2022-12-23
  • 2022-02-12
  • 2022-12-23
  • 2021-08-24
  • 2022-12-23
  • 2022-01-26
  • 2022-12-23
相关资源
相似解决方案