git init模板,替换修改后的钩子 [英] git init template, replacing modified hooks

查看:146
本文介绍了git init模板,替换修改后的钩子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不断更新我的本地git钩子。我有一个仓库来存放我的.git模板。这意味着我不断运行git init --template = .. / git-template来更新我的钩子更改的回购站。问题:每次运行git init - -temp ...,我需要先删除.git / hooks中的钩子,这些钩子将被更新的钩子替换。这很烦人。我知道我可以编写脚本从我想要更新的回购库中删除这些钩子,但是这个功能已经内置到git中了吗? 解决方案

这并不完全回答你的问题,但我只是将所有.git / hooks文件夹符号链接到一个公共位置,以便我可以修改它;这可能会让你的生活更轻松

I am constantly updating my local git hooks. I have a repo to house my .git template. This means that I am constantly running git init --template=../git-template to update repos with my hook changes.

Problem: Everytime I run git init --temp..., I need to first remove the hooks in .git/hooks that will be replaced with the updated hooks. This is annoying. I know I can script the removal of these hooks from the repo that I want to update, but is this functionality built into git already?

解决方案

This doesn't exactly answer your question, but I just symlink all my .git/hooks folders to a common location so I can just modify that; that might make your life easier

这篇关于git init模板,替换修改后的钩子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆