git钩后合并 - 错误:无法运行 [英] git hook post-merge - error: cannot run
问题描述
在我做了一个后合并钩子之后触发一个git钩子。
脚本如下所示:
#!/ bin / sh
git log> gitlog.txt
该文件被称为合并后,并拥有与所有者相同的所有者运行pull命令。
当你做我的git拉[远程]主人我得到这个错误:
错误:无法运行.git / hooks / post-merge:没有这样的文件或目录
合并后文件位于.git / hooks文件夹中。
您可能想要检查sh后面是否没有CR或类似隐形字符。 b
有时当文件通过windows系统时会发生这种情况。
我认为在vi中会显示一个^ M
如果是这种情况,请删除它,它应该可以正常工作。
To trigger a git hook after a pull i made a post-merge hook. The script looks like this:
#!/bin/sh
git log > gitlog.txt
The file is called 'post-merge' and has the same owner as the one that runs the pull command. Also it has the right permissions : 755.
When u do i git pull [remote] master i get this error:
error: cannot run .git/hooks/post-merge: No such file or directory
The post-merge file is in the .git/hooks folder.
You may want to check if there is no CR or similar invisible character behind the sh.
This happens sometimes when a file passed through a windows system.
I think in vi it will show up a ^M
If that is the case remove it and it should work.
这篇关于git钩后合并 - 错误:无法运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!