이것은 늦었지만 더 나은 해결책을 찾았습니다 (몇 년 전).
자식 - 가정 - 상태와 자식-unassume-상태를 사용
#!/usr/bin/env ruby
# used to ignore modified files -- e.g configuration files
ret=%x{git status --porcelain}
files=ret.lines.map { |x| x.split[1] }
files.each do |file|
# makes files resistant to git reset hard
%x{git update-index --skip-worktree #{file}}
%x{git update-index --assume-unchanged #{file}}
end
및 대한
자식-unassume
#!/usr/bin/env bash
# used to ignore modified files -- e.g configuration files
cd .git
rm index
cd ..
git reset
당신이 당신의 구성 파일이 수정되었지만 상태 및 기타 무시 할 수 있습니다이 방법 git add 명령. 마음이 바뀌면 git-unassume을 실행하십시오.
출처
2016-12-15 23:08:02
hbt