.gitignore 파일에 지정해서 변경파일 내역에서 제외하지만 임시로 제외할 수 있는 방법도 있다.


변경파일 임시 제외

git update-index --assume-unchanged 파일명


변경파일 임시 제외 취소

git update-index --no-assume-unchanged 파일명


변경파일 임시 제외 모두취소

git update-index --really-refresh


예시

$ git status

On branch master

Your branch is up-to-date with 'origin/master'.

Changes not staged for commit:

  (use "git add <file>..." to update what will be committed)

  (use "git checkout -- <file>..." to discard changes in working directory)


modified:   .gitignore

modified:   README.md


no changes added to commit (use "git add" and/or "git commit -a")


$ git update-index --assume-unchanged README.md

$ git status

On branch master

Your branch is up-to-date with 'origin/master'.

Changes not staged for commit:

  (use "git add <file>..." to update what will be committed)

  (use "git checkout -- <file>..." to discard changes in working directory)


modified:   README.md


no changes added to commit (use "git add" and/or "git commit -a")


'Git' 카테고리의 다른 글

Git - merge 취소하기  (0) 2016.12.21
Git - branch 목록보기, branch 변경하기  (0) 2016.12.19
Git - add, commit, push 취소하기  (0) 2016.11.11
Posted by G4.
,