git - 如何让 `git lfs` 识别 `core.filemode=false`?
问题描述
我在 centos 7 中使用git-lfs 2.4.2
with。git git 1.8.3.1
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
通过How to write post-checkout hook to chmod 666 to all files? ,我将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 跟踪的文件)修改 mod 如下:
# 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
。怎么解决?
解决方案
推荐阅读
- testing - 运行 diskspd 时出错
- css - .active 自定义引导轮播控件上的类
- php - Woocommerce - 调用未定义的方法 WC_Order::get_order_discount()
- android - Recycler 中的 Diff Util 实现在每次刷新时将其滚动到顶部
- ruby-on-rails - 查询中的 OR 条件
- hive - 主键和外键约束在 Hive 中如何工作?
- android - 删除 svg click 上的“全选”蓝色水滴
- javascript - 我的 Carousel Materialise 不起作用。我正在使用最新版本 1.0.0
- .net - 在远程环境的 web api 中访问 swagger 时遇到问题?
- authentication - 如何在 Asp.Net core 2.0 身份中的身份验证 cookie 过期之前获得剩余时间