Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法使用服务器端预接收挂钩更改正在推送到服务器的文件?
假设我想在文件末尾添加一些内容,例如:
//End of Org
每次有人推送到我的回购。
有没有办法可以更改使用的文件git hooks?
git hooks
我宁愿使用过滤器驱动程序,它可以对每个文件的内容进行操作,以检查您的行是否存在,如果不存在,则在结帐步骤中添加它。
那将是:
只是为了完整起见:从名称中应该很明显,您所要求的根本是不可能的。pre-receive钩子不能更改任何文件,因为它还没有收到任何文件!
pre-receive