提交特定文件时不执行 SVN "post commit hook"

Don't execute SVN "post commit hook" when a specific file is committed

有什么方法可以在提交特定文件时不 运行 "post commit hook" 或跳过 "post commit hook statement" 吗?

您可以在 post-commit 脚本中使用测试。 svnlook changed repository_directory 将显示更改了哪些文件 - 可以使用 grep 或类似的。

例如:

#!/bin/sh

/usr/bin/svnlook changed /svn/repo | grep -w ' yourfile$' && exit 0

# here begin the main part of your (original) hook

这对我有用:

"C:\Program Files\VisualSVN Server\bin\svnlook" changed C:\Repositories\sbm2| findstr version.json && EXIT /B
#here my main part of post-commit-hook will begin

谢谢@uzsolt