Cem*_*emo 29 git github post-commit-hook
有没有办法通知人们某些文件的更改?具体来说,我想跟踪*.sql文件的更改,并通知我们的开发人员进行更改.如何配置post commit hooks以通知?
Coo*_*per 20
如果您希望人们通过电子邮件收到通知,并且您希望他们管理自己的通知,那么https://app.github-file-watcher.com/应该可以做到 - 它会监控任何公共回购,并会通知您通过电子邮件更改任何文件,特定文件或符合条件的文件.
使用git diff-tree
你的后收到钩:
git diff-tree --name-status -rz
Run Code Online (Sandbox Code Playgroud)
您可以grep结果以检查某些文件是否被修改(状态' M
'),如本答案中所述.
你可以找到很多例子gist.github.com
,有这一个使用--name-status
选项.
我知道已经有一段时间了,但是当我在寻找类似的东西时偶然发现了这个线程。我查看了 Cooper 的 GitHub File Watcher,但它不适用于私有存储库,也不是开源的。
所以我最终构建了自己的解决方案:https : //github.com/jesalg/commit-hawk。在这里发布这个以防万一有人仍在寻找这样的工具。
GitHub(截至 2019 年 12 月)在预览版中提供了一些新的通知功能,包括CODEOWNERS的概念,它允许对如何配置更改的通知进行相当精细的控制。
需要启用预览功能才能正常工作,但所需要做的就是CODEOWNERS
在 root、.docs/
或.github/
.
这是文档中的示例文件:
# This is a comment.
# Each line is a file pattern followed by one or more owners.
# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
# @global-owner1 and @global-owner2 will be requested for
# review when someone opens a pull request.
* @global-owner1 @global-owner2
# Order is important; the last matching pattern takes the most
# precedence. When someone opens a pull request that only
# modifies JS files, only @js-owner and not the global
# owner(s) will be requested for a review.
*.js @js-owner
# You can also use email addresses if you prefer. They'll be
# used to look up users just like we do for commit author
# emails.
*.go docs@example.com
# In this example, @doctocat owns any files in the build/logs
# directory at the root of the repository and any of its
# subdirectories.
/build/logs/ @doctocat
# The `docs/*` pattern will match files like
# `docs/getting-started.md` but not further nested files like
# `docs/build-app/troubleshooting.md`.
docs/* docs@example.com
# In this example, @octocat owns any file in an apps directory
# anywhere in your repository.
apps/ @octocat
# In this example, @doctocat owns any file in the `/docs`
# directory in the root of your repository.
/docs/ @doctocat
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
6952 次 |
最近记录: |