小编HNy*_*ard的帖子

Cron 作业检查 Git 存储库中的更改

我们刚刚将服务器配置移至 Git 存储库。因此,不应在任何存储库文件夹中进行任何更改。我在考虑如何设置一个 cron 作业来检查任何未提交的更改。

如何设置 cron 作业来检查 Git 存储库中的更改?

Grepinggit status命令的输出可能只是这样做。Grep 和 cron 工作不是我的强项。以下是一些示例输出git status

将包含 git 存储库(例如/path/gitrepo/)的文件夹与已更改的文件保持一致

$ git status
# On branch master
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#   modified:   apache2/sites-enabled/000-default
#
# Untracked files:
#   (use "git add <file>..." to include in what …
Run Code Online (Sandbox Code Playgroud)

monitoring grep git cron

8
推荐指数
2
解决办法
7906
查看次数

标签 统计

cron ×1

git ×1

grep ×1

monitoring ×1