development

git update-index --asume-unchanged는“치명적인 파일을 표시 할 수 없습니다”를 반환합니다

big-blog 2020. 7. 19. 00:05
반응형

git update-index --asume-unchanged는“치명적인 파일을 표시 할 수 없습니다”를 반환합니다


게시물 의 OP와 동일한 문제가 있지만 정답으로 표시된 답변을 이해하지 못합니다 (상황을 해결하는 방법을 설명하지 못합니다)

나는 이것을 하고이 오류를 얻는다 :

$ git update-index --assume-unchanged web.config
fatal: Unable to mark file web.config
  1. 파일이 저장소에 추가되었습니다

  2. 에 없습니다 .git/info/exclude

  3. 들어 있지 .gitignore않지만 (그렇지만 가져갔습니다.)를 사용하여 web.config를 추가 git add -f web.config하고 커밋 한 다음 해당 변경 사항을 리포지토리에 푸시했습니다.

  4. 내가 힘내 ls 파일을 할 때 -o 그것은 없다

그래서 어떻게 고칠 수 있습니까?


나는 당신과 같은 문제를 겪고 있었고 위에서 언급 한 것과 같은 4 단계를 밟았으며 동일한 결과를 얻었습니다. 여기에는 실행시 내 파일이 나열되었다는 사실이 포함되었습니다 git ls-files -o. 그러나 내 경우에는 실행 git update-index --assume-unchanged할 때 나열되지 않은 파일에 대해서도 실행 시도했지만 ls-files -o여전히 동일한 오류 " fatal: Unable to mark file" 가 발생했습니다 .

아마도 버그라고 생각하고 최신 버전의 git을 다운로드했지만 도움이되지 않았습니다.

마지막으로 깨달은 것은 이 명령이 대소 문자를 구분 한다는 것입니다 ! 여기에는 전체 경로와 파일 이름이 포함됩니다. 적절한 경로로 전체 경로가 지정되도록 디렉토리 경로를 업데이트 한 후 명령이 제대로 실행되었습니다.

이것은 Git for Windows와 관련이 있으므로 결과는 다른 플랫폼에 따라 다를 수 있습니다.


Mac에서도 같은 문제가 발생했습니다. 대소 문자 구분은 나에게 문제가되지 않았습니다. 문제는 먼저 자식을 재설정해야했습니다.

문제:

 git update-index --assume-unchanged index.php
 fatal: Unable to mark file index.php

해결책:

git reset HEAD
Unstaged changes after reset:
M   index.php
git update-index --assume-unchanged index.php

필자의 경우, 내가 표시하고있는 트리는 디렉토리였으며 파일은 아니었고 이름 뒤에 슬래시가 누락되었습니다.

잘못된-

git update-index --assume-unchanged directory-name

수정-

git update-index --assume-unchanged directory-name/

끝에 슬래시 (/)를 적어 둡니다.


치명적 : 파일 Localization / el-GR.js를 표시 할 수 없습니다

당신이 할 수있는 일은 :

  1. 로컬에 파일이있는 올바른 경로로 이동하십시오 (GITBASH에서)
  2. 색인 업데이트 $git update-index --assume-unchanged <file name>

이것은 나를 도왔다! :)


* .orig 파일의 추적을 해제하려고 할 때이 문제가 발생했습니다.

이것이 내가 그들을 추적 해제하기 위해 한 것입니다.

$git reset -- *.orig

그래도 작동하지 않으면 :

$git clean -fd

git repo에 파일을 추가하지 않으면 파일이 git repo에 추가되었는지 확인한 다음 작동합니다.


경로에 공백이 있으면 케이싱 권한이 있어도이 오류가 발생할 수 있습니다.

"치명적인"오류가 발생합니다.

git update-index --assume-unchanged code/Solution Files/WebEssentials-Settings-json

문제를 해결하려면 경로 주위에 따옴표를 추가하십시오.

git update-index --assume-unchanged "code/Solution Files/WebEssentials-Settings-json"

내 문제는 재귀 할 것이라고 가정하고 와일드 카드로 명령을 시도했지만 그렇지 않았습니다.

그래서 내가 한 일은

$ git reset HEAD
Unstaged changes after reset: 
M   .gradle/1.9/taskArtifacts/cache.properties.lock
M   .gradle/1.9/taskArtifacts/fileHashes.bin
M   .gradle/1.9/taskArtifacts/fileSnapshots.bin
M   .gradle/1.9/taskArtifacts/outputFileStates.bin
M   .gradle/1.9/taskArtifacts/taskArtifacts.bin

실행

$ git update-index --assume-unchanged .gradle/1.9/taskArtifacts/*

그때 나를 위해 일하고 OP와 내 문제가 발생하지 않았습니다.


--assume-unchanged느린 파일 시스템에 관한 것이므로 사용자는 Git이 변경되지 않은 것으로 가정 할 수 있으므로 Git이이 파일을 확인할 필요가 없다고 약속합니다. 그러나 일부 명령은 여전히``놀람 ''을 확인하고 생성합니다!

변경된 파일에는 사용하지 마십시오.

그 소식을 전하는 사람이되어 죄송합니다 (문서를 변경하는 과정에 패치가 있습니다).


"web.config"가 체크인되어 있는지 확인하십시오.

그렇지 않으면이 오류 메시지가 나타납니다.


Maybe useful for someone. I had the same problem and was no syntax problem, no name with spaces, no path problem, and git reset command didn't work. I was commiting from a folder inside apache www and apache service was stopped. Started again apache service and the error is gone


In my case, I tried to use any of the methods above, but no luck.

After many attempts, I just thought to add my file to index through.

git add myfile.php

Git refused this action but he advised me to make it forcibly.

git add myfile.php -f

And that worked for me.


For all future visitors. None of the above resolved my issue. What I realized is the .gitignore file must be placed in the right directory. In my case, once I moved .gitignore to application's root directory the issue was resolved.


Check if the file to be marked exists and spells correctly, especially the file path and file separator. The file separators of windows system and linux system are in different directions.


I found that sometimes this doesn't work because you've already committed the file to your .gitignore and made a push or pull. You only need to make the push and your file should be ignored on subsequent commits even when you locally modify the file.

참고URL : https://stackoverflow.com/questions/12920652/git-update-index-assume-unchanged-returns-fatal-unable-to-mark-file

반응형