如何在 Git 中限制推送大小
How to restrict push size in Git
我有 gitolite-admin。
有时我们的程序员不使用 .gitignore
文件并将整个目录提交到远程仓库。
如何在 git 中限制推送大小?
我尝试在 git 配置中搜索但未成功。
与git提交无关。
您需要为此作业设置挂钩。
你的钩子会检查你想做什么,然后决定是否批准推送。
在你的钩子中你会有这样的东西:
# in the hook use this line to get the size of each file
git ls-tree -l
如果您想在存储库中看到相同的结果,请使用:
git ls-tree HEAD -l
How to write hooks
:
这里有一个很好的示例,说明如何在挂钩中吸引注意力:
您可以限制更改的文件数量。
在您的配置文件中:
repo @all
- VREF/COUNT/50 = @all
我有 gitolite-admin。
有时我们的程序员不使用 .gitignore
文件并将整个目录提交到远程仓库。
如何在 git 中限制推送大小?
我尝试在 git 配置中搜索但未成功。
与git提交无关。
您需要为此作业设置挂钩。
你的钩子会检查你想做什么,然后决定是否批准推送。
在你的钩子中你会有这样的东西:
# in the hook use this line to get the size of each file
git ls-tree -l
如果您想在存储库中看到相同的结果,请使用:
git ls-tree HEAD -l
How to write hooks
:
这里有一个很好的示例,说明如何在挂钩中吸引注意力:
您可以限制更改的文件数量。 在您的配置文件中:
repo @all
- VREF/COUNT/50 = @all