We are creating a system in which users will be able to push arbitrary content to a shared Git repository. Our server will then checkout the repository and use the files.
To reduce risks, I'd like the git checkout
command not to write any .exe
, .cmd
, .bat
etc. on disk, and control which file types will be written.
How to configure Git (either using a configuration file, or a command-line argument) to ignore/skip specific file types at checkout?
Note that I'm running Git for Windows.
答案 0 :(得分:1)
我首先想到的是使用涂抹过滤器,您可以将其指定为gitattributes
文件(Customizing Git - Git Attributes)的一部分。
或者,如果你想首先防止这些文件被提交,可能是你的git服务器上放置一个pre-recieve
钩子(Git hooks)。