git에 이상한 문제가 있습니다. 내 .gitignore 파일은 추적 된 것으로 보이지만이를 커밋 할 수는 없습니다.git 별 추적 파일
명령 라인 :
[email protected] ~/repository (my_first_branch)
$ git checkout my_second_branch
error: Your local changes to the following files would be overwritten by checkout:
.gitignore
Please, commit your changes or stash them before you can switch branches.
Aborting
[email protected] ~/repository (my_first_branch)
$ git add .gitignore
[email protected] ~/repository (my_first_branch)
$ git commit
# On branch my_first_branch
nothing to commit, working directory clean
[email protected] ~/repository (my_first_branch)
$
그래서 내가 때문에 .gitignore의 다른 지점을 체크 아웃 할 수없는 나는 그것에 대해 아무것도 할 수 없습니다.
유일한 해결책은 수동으로 .gitignore를 삭제하는 것이지만이를 추적하고 싶습니다. 파일 .gitignore가 .gitignored에 없기 때문에 추적되지 않는 이유를 알 수 없습니다.
커밋하거나 숨길 수 없습니다.
UPDATE : 자식 상태 : 당신이 정말로 당신이 그것을 커밋하지 않으려면 당신은 .gitignore 파일에 .gitignore을 추가 할 수 있습니다 원하는 경우
[email protected] ~/repository (my_first_branch)
$ git status
# On branch my_first_branch
nothing to commit, working directory clean
'git status'의 결과를 보여줄 수 있습니까? – gregor
@gregor가 업데이트되었습니다. – Ari
.gitignore에 권한 문제가있을 수 있습니까? 또 다른 가능성은 .gitignore (이미 저장소에있는 경우)에 일부 줄 끝 문제가 있다는 것입니다. – pyfex