Git의 파일 권한에 관한 몇 가지 질문을 읽었으며 여전히 약간 혼란 스럽습니다. GitHub에 대한 저장소가 다른 곳에서 분기되었습니다. 병합 후, 동일해야합니다. 하나:
$ git diff --summary origin/epsilon master/epsilon
mode change 100644 => 100755 ants/dist/sample_bots/csharp/compile.sh
mode change 100644 => 100755 ants/dist/starter_bots/coffeescript/MyBot.coffee
mode change 100644 => 100755 ants/dist/starter_bots/coffeescript/ants.coffee
mode change 100644 => 100755 ants/util/block_test.sh
mode change 100644 => 100755 manager/mass_skill_update.py
mode change 100644 => 100755 worker/jailguard.py
mode change 100644 => 100755 worker/release_stale_jails.py
mode change 100644 => 100755 worker/start_worker.sh
파일 권한을 변경하려고 시도했지만 diff 결과는 변경되지 않습니다.
답변
내가 여기에 윈도우에 (도) 권한을 변경하는 방법의 해결책을 발견 : http://blog.lesc.se/2011/11/how-to-change-file-premissions-in-git.html
예를 들어 다음 명령은 사용자 실행 권한을 임의의 파일에 추가합니다.
git update-index --chmod=+x <file>
답변
스택 오버 플로우 에 대한 또 다른 질문에서
Git이 파일 모드 (chmod) 변경을 무시하도록하려면 어떻게합니까?
시험:
git config core.filemode false
에서 자식-설정 (1) :
core.fileMode If false, the executable bit differences between the index and the working copy are ignored; useful on broken filesystems like FAT. See git-update-index(1). True by default.
답변
Git Bash를위한 편리한 원 라이너 :
find . -name '*.sh' | xargs git update-index --chmod=+x
모든 .sh
파일을 실행 파일로 표시합니다 . 그 후, 당신은 단지해야합니다 git commit
.
답변
Cygwin git (또는 Linux git도 사용한다고 가정)을 사용하면 $ projdir / .git / config의 프로젝트 수준에서 core.filemode 설정이 설정되었을 가능성이 큽니다. Cygwin git과 Windows git이 항상 존재하지 않는 파일 모드 변경없이 Windows 파일 시스템에서 공존하기 위해서는 다음을 수행해야한다는 것을 알았습니다.
- $ projdir / .git / config에서 행 설정 core.filemode를 삭제하십시오.
- Windows git에서 “git config –global core.filemode false”를 실행하십시오.
이를 통해 Cygwin git은 일반적으로 관련된 파일 모드 변경 사항을 계속 볼 수 있지만 Windows git에 표시되는 파일 모드 변경 사항을 무시하도록 지시합니다.
답변
먼저 아래 명령을 사용하여 파일 권한을 확인하십시오.
git ls-files --stage
그런 다음 권한을 변경하십시오. 여기서 “x”는 실행 권한을 나타냅니다.
git update-index --chmod=+x 'scriptname.ext'
이제 권한을 다시 확인하십시오.
git ls 파일 –stage
================================================
Windows PC를 사용하지만 Linux 시스템에 배포하는 경우 리눅스 컴퓨터에서 실행할 수 있도록 먼저 아래 명령을 실행하십시오.
dos2unix scriptname.ext scriptname.ext
답변
우분투, 커밋, 푸시 및 모두에서 파일 권한을 변경하여 문제를 해결했습니다. Windows / NTFS의 msysgit에서는 작동하지 않는 것 같습니다.