符号链接到git中的钩子 [英] Symbolic link to a hook in git

查看:108
本文介绍了符号链接到git中的钩子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了自己的自定义合并后钩子,现在我在我的主项目文件夹中添加了一个钩子目录(因为git没有跟踪.git / hooks中的变化),在某处我读到可以使符号从钩子链接到.git /钩子,所以我不必将文件从一个文件夹复制到另一个文件夹,每次有人改变它,所以我试过:

I wrote my own custom post-merge hook, now I added a "hooks" directory to my main project folder (since git doesn't track changes in .git/hooks), somewhere I read that I can make a symbolic link from hooks to .git/hooks so I don't have to copy the file from one folder to the other every time someone changes it so I tried:

ln -s -f hooks / post-merge .git / hooks / post-merge

但似乎没有工作,任何想法为什么? ln hooks / post-merge .git / hooks / post-merge工作正常,但建立一个硬链接与copyin相同,我猜... ...

But it doesn't seem to work, any ideas why? "ln hooks/post-merge .git/hooks/post-merge" works fine but making a hard link is the same as copyin I guess....

推荐答案

您刚刚使用了错误的路径,它应该是:

you just used wrong path, it should be:

ln -s -f ../../hooks/post-merge .git/hooks/post-merge

这篇关于符号链接到git中的钩子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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