error: Your local changes to the following files would be overwritten by merge: .DS_Store

1315 단어 git

Git ignore .gitignore

error: Your local changes to the following files would be overwritten by merge: .DS_Store

both modified: .DS_Store

해결 방법:
만약 당신이push 후에 원격 창고가 당신을 추적할 것입니다.DS_스토어 파일, 다른 사람도 이 파일을 제출하면 충돌을 일으킬 수 있습니다.일반적으로 이 파일은 첫 번째 push 전에 ignore 목록에 추가됩니다.
git rm -r --cached .DS_Store

이 코드는 추적을 해제하고 캐시를 제거하는 것을 의미한다.git rm --cached filename
만약 여전히 안 된다면 다음과 같은 절차에 따라 집행해야 한다.
mv .gitignore .gitignore_bak
git checkout .DS_Store
git rm -r --cached .DS_Store
mv .gitignore_bak .gitignore

아니면 이렇게 하려고 할 수도 있습니다.
git stash
git pull
git stash pop

새 프로젝트는 우선 ignore를 제출해야 합니다


이것은 첫 번째 임무이다. 그렇지 않으면 충돌과 현지화된 서류가 많이 제출되어 팀워크에 영향을 줄 것이다.그래서lib를 만들 때 the first things는 하나를 만듭니다.gitignore 파일.Github에 ignore 프로젝트가 있습니다. 언어에 따라 다른 종류의 ignore 템플릿이 준비되어 있습니다. 다운로드하러 가세요.

전역 ignore와 국부 ignore

  • 로컬 창고 무시.git/info/exclude
  • 현재 작업 디렉터리
    .gitignore, 
     .gitignore, exclude 
    Ignore , 。
    
  • 전역적으로 파일을 무시합니다
     ~/.gitconfig gitignore 
    
        [core]
        excludesfile =/Users/duofei/.gitignore_global
  • 좋은 웹페이지 즐겨찾기