windows系统自动git pull

         公司有个服务器是windows的,每次提交代码都要远程登录git pull.时间长了受不了,想搞个计划任务。查了下相关资料,有两种方式。

    一,命令行

        打开cmd,

        schtasks /create /sc minute /mo 1 /tn "test" /tr "F:\xxx\www"

        schtasks类似于linux的crontab

         /create创建

          /sc 时间类型

          minute 分

          /mo 间隔

           /tn 计划任务名

           /tr 脚本路径

    二,windows最大的特点,点点点

            windows系统自动git pullwindows系统自动git pull

开始-管理工具-任务计划程序,ps:win10右击我的电脑-管理-任务计划程序

windows系统自动git pull

名称:随便起

描述:随便写

下一步

windows系统自动git pull

时间,后面还可以改

windows系统自动git pull

windows系统自动git pull

PS:这里要特别注意,程序或脚本的起始于一定要写,不然找不到路径执行,win默认windows/system32

windows系统自动git pull

windows系统自动git pull

 自定义执行时间和周期

最少1分钟。

参考链接:https://blog.****.net/qq_38375394/article/details/80093003

                https://blog.****.net/voodota/article/details/79755074