git .DS_Store 파일 없애기

svenskpotatis·2023년 11월 3일

Mac OS 환경에서 git을 사용하면 repository에 .DS_Store 파일이 자동으로 생긴다. .gitignore를 통해 .DS_Store를 무시하게 할 수 있다.

터미널에 입력:

  1. 해당 폴더 안의 모든 .DS_Store 파일 삭제
find . -name .DS_Store -print0 | xargs -0 git rm --ignore-unmatch -f
  1. .gitignore에 추가하여 다시 commit되지 않도록 하기
echo .DS_Store >> .gitignore
  1. add -> commit -> push
git add .gitignore
git commit -m '.DS_Store is banished'
git push origin main

참고

0개의 댓글