我希望在git push
之前运行压缩脚本,以便在用户尝试将更改推送到远程存储库时,它会检查可压缩资产中未提交的更改,中止git push
,运行git commit
,然后再次运行git push
。预推git挂钩?
是否可能只使用git挂钩?
我希望在git push
之前运行压缩脚本,以便在用户尝试将更改推送到远程存储库时,它会检查可压缩资产中未提交的更改,中止git push
,运行git commit
,然后再次运行git push
。预推git挂钩?
是否可能只使用git挂钩?
看看this patch。
请参阅.git/hooks/
在您的回购示例钩子,也许你会看到一些替代。
Git在1.8.2
版本中获得pre-push
挂钩。
样品pre-push
脚本:https://github.com/git/git/blob/87c86dd14abe8db7d00b0df5661ef8cf147a72a3/templates/hooks--pre-push.sample
1.8.2版本说明草案谈论新推前钩:https://github.com/git/git/blob/master/Documentation/RelNotes/1.8.2.txt