반응형
- tracking 중인 file ignore하기
- git update-index --skip-worktree <ignore하려는 파일, example:src/main/resources>
- git update-index --assume-unchanged <ignore하려는 파일>
- --skip-worktree와 --assume-unchanged의 차이 설명함
https://hashrocket.com/blog/posts/ignore-specific-file-changes-only-on-current-machine-in-git - 각각 취소하려면
- git update-index --no-skip-worktree <ignore하려는 파일>
- git update-index --no-assume-unchanged <ignore하려는 파일>
- 제대로 명령어가 된건지 확인하려면 git ls-files -v 로 파일의 상태 확인가능
- H: cached
- S: skip-worktree
- M: unmerged
- R: removed/deleted
- C: modified/changed
- K: to be killed
- ?: other
git ls-files 자세한 사용법 https://mirrors.edge.kernel.org/pub/software/scm/git/docs/git-ls-files.html
- git ignore하는 방법들
- gitignore에 추가: push해서 다른 애들도 같이 적용해야하는듯
- .git/info/exclue: push안하고 local에서만 적용가능, but 이미 tracking된 file은 안되는듯
- git global설정 변경
- 아래 링크에 설명있음
https://docs.microsoft.com/en-us/azure/devops/repos/git/ignore-files?view=azure-devops&tabs=visual-studio - git exclude SOME_FILE 이런 명령어도 있다고 하는데 해보진 않았음
반응형
'git' 카테고리의 다른 글
git author/committer, owner/uploader/reviewer 차이 (0) | 2022.05.17 |
---|---|
git stash: branch에 따라 달라지지 않고 전체적으로 공유됨 (0) | 2019.12.18 |
git bash shorcuts: copy(ctrl+insert), paste(shift+insert) (0) | 2019.06.11 |
git rebase, cherry-pick을 잘 이해해보자 (0) | 2019.06.11 |
git tag (0) | 2019.06.07 |