1

我为 Windows 安装了 git-lfs。Git Bash对于和来说,这似乎都在我的道路上PowerShell。这是来自的输出Git Bash

502618458@G13G3Q72E MINGW64 ~
$ which git-lfs
/c/Program Files/Git LFS/git-lfs

502618458@G13G3Q72E MINGW64 ~
$ git lfs version
git-lfs/1.4.4 (GitHub; windows amd64; go 1.7.3; git cbf91a9)

然而,当我运行时:

$ git lfs install
Updated pre-push hook.
Git LFS initialized.

我得到以下内容pre-push

#!/bin/sh
command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting .git/hooks/pre-push.\n"; exit 2; }
git lfs pre-push "$@"

我试过删除pre-push钩子并重新安装,我仍然得到相同的结果。

我测试了推送应该跟踪的文件... Used git lfs track, added.gitattributes和跟踪的文件,但它被推送到常规 git repo 而不是 git-lfs 存储中。

知道为什么我无法git lfs install将正确的内容放入pre-push钩子或知道任何解决方法吗?

4

1 回答 1

2

"This repository is configured for Git LFS but 'git-lfs' was not found on your path."对我来说是一个红鲱鱼。pre-push脚本中有这个语句是正常的。

如果我运行,command -v git-lfs || echo WTF我会得到 git-lfs 的路径。如果我用我得到git-lfs的错字替换上面的命令git-lsfWTF

我只是没有花足够的时间来理解pre-push剧本。

我的问题是我没有在我的 Gitlab 配置文件中启用 lfs 支持。

于 2016-10-30T13:26:11.710 回答