Как заставить `git lfs` распознавать` core.filemode = false`? - PullRequest
0 голосов
/ 07 января 2019

Я использую git-lfs 2.4.2 с git 1.8.3.1 в сентосах 7. git config, как показано ниже:

[root@localhost www]# git config --list
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
filter.lfs.clean=git-lfs clean -- %f
core.safecrlf=true
core.filemode=false
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.safecrlf=true
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master

Через Как записать хук после проверки на chmod 666 для всех файлов? , я установил post-checkout хук, как показано ниже:

##!/bin/bash
## post-chekcout script

set -e

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/post-checkout.\n"; exit 2; }
git lfs post-checkout "$@"

exec chmod -R a+rwX .

После git checkout -b develop, множество .jpg, .gif (файлов, отслеживаемых git-lfs) модом, как показано ниже:

# On branch develop
# Changes not staged for commit:
#   modified:   admin/images/admin_tit_bg.jpg
#   modified:   user/images/ajax_loader.gif

После этого я запускаю git commit -am, затем git checkout master, получаю ошибки ниже:

Pointer file error: Unable to parse pointer at: "admin/images/admin_tit_bg.jpg"
Pointer file error: Unable to parse pointer at: "user/images/ajax_loader.gif"
Checking out files: 100% (321/321), done.
Switched to branch 'master'

Казалось, git-lfs не распознает core.filemode=false. Как ее решить?

...