git update-index --assume-unchanged xx/filename 忽略本地文件修改
忽略文件夾?
git update-index --assume-unchanged $(git ls-files | tr ‘\n’ ’ ')
取消忽略
git update-index --no-assume-unchanged
忽略列表
git uls-files -v | grep '^h\ ’
取消所有忽略
git ls-files -v | grep ‘^h’ | awk ‘{print $2}’ |xargs git update-index --no-assume-unchanged
參考鏈接
https://www.cnblogs.com/wt645631686/p/10007328.html
在文件.git\info\exclude裏面增加需要的忽略的未跟蹤文件
忽略已跟蹤文件
git update-index --skip-worktree $(git ls-files --modified)
取消忽略
git update-index --no-skip-worktree
查看忽略文件:
git ls-files -v | grep ‘^S’
合併時忽略文件
https://www.jianshu.com/p/09b546b936a7
git config --global merge.ours.driver true
echo ‘index.php merge=ours’ >> .gitattributes
git add .gitattributes
git commit -m ‘chore: Preserve index.php during merges’