linux - 使用带有 git Hook 的脚本时找不到文件或目录

标签 linux git shell githooks

我目前正在尝试创建自定义 mLinux 镜像,并且我正在按照此网站的说明进行操作:http://www.multitech.net/developer/software/mlinux/mlinux-building-images/building-a-custom-linux-image/

我跟着他们,直到此时一切正常。

当我尝试运行安装文件时(包括这段代码:

set -e
BUILDCONF=build/conf/local.conf

if [ "$1" != "--update" ]; then
  echo ""
  echo "Setting up git hooks..."
ln -s ../../scripts/git-hooks/post-merge .git/hooks/post-merge || true
ln -s ../../scripts/git-hooks/post-checkout .git/hooks/post-checkout || 
true
  ln -s ../../scripts/git-hooks/pre-commit .git/hooks/pre-commit || true
  ln -s ../../scripts/git-hooks/pre-push .git/hooks/pre-push || true
fi

echo ""
echo "Updating git submodules..."
git submodule update --init

)

我收到每个 Hook 的以下错误消息: 无法创建快捷方式 .gt/hooks/( Hook 的名称):找不到文件或目录(翻译自德语)。 另外还有:git: submodule is not a command。 有没有人知道我可能忘记了什么/哪里出了问题?

提前致谢!

最佳答案

作为show here

The yocto version I am using for Edison is this one: https://github.com/edison-fw/meta-intel-edison

The problem happens because the git version on Edison board is missing some parts. In this case the git-submodules binary is missing in /usr/libexec/git-core

所以首先检查你的Git安装是否在你的构建环境中完成。
如果没有,您可能需要使用从更完整的发行版中获取的二进制文件来完成它。

关于linux - 使用带有 git Hook 的脚本时找不到文件或目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56208737/

相关文章:

linux - 错误 : grub-efi-amd64-signed & shim-signed

c# - 从 linux samba 共享和缓存中读取文件

git - 当重命名文件很常见时替代 git cherry-pick

bash - Grep spotify songname 从 html doc 到文本文件

linux - 在 linux 日志文件中特定事件后获取行

linux - 如何添加用户以允许 ssh 隧道访问?

git - 如何恢复中止或中断的 "git clone"?

git - Azure DevOps错误: Git checkout failed with exit code: 1

php - linux 作业的命令无法从 php 运行

linux - 如何在管道的两侧使用 sudo -u