使用带有 git 挂钩的脚本时找不到文件或目录

File or Directory not found when using script with git hooks

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

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

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

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

if [ "" != "--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

)

我收到每个挂钩的以下错误消息: 无法创建快捷方式 .gt/hooks/(挂钩的名称):找不到文件或目录(翻译自德语)。 此外还有:git:子模块不是命令。 有没有人知道我可能忘记了什么/出了什么问题?

提前致谢!

作为

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 安装是否已在您的构建环境中完成。
如果没有,您可能需要使用从更完整的发行版中获取的二进制文件来完成它。