Состояние Git дает разные результаты в Cygwin и Git Bash (Windows 10) - PullRequest
0 голосов
/ 20 сентября 2019

Я установил cygwin (и git с помощью диспетчера пакетов cygwin) и git bash для Windows.

Я только что клонировал репозиторий с помощью оболочки cygwin, а затем открыл оболочку git bashи оболочка cygwin в корне хранилища.

Затем я выполняю git status из каждой оболочки.Git bash находит изменение (разрешение на доступ к файлу), но cygwin НЕ делает этого, и я пытаюсь понять, почему.

Ниже приведены подробности:

Git Bash (показать измененный файл)

$ git --version
git version 2.23.0.windows.1
$ git status
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   script.sh

no changes added to commit (use "git add" and/or "git commit -a")

$ git diff
diff --git a/script.sh b/script.sh
old mode 100755
new mode 100644

$ git config -l | grep core
core.symlinks=true
core.autocrlf=false
core.fscache=true
core.editor='C:\Program Files (x86)\Notepad++\notepad++.exe' -multiInst -notabbar -nosession -noPlugin
core.editor='C:/Program Files (x86)/Notepad++/notepad++.exe' -multiInst -nosession
core.autocrlf=false
core.preloadindex=true
core.fscache=true
core.filemode=true
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.ignorecase=true

Cygwin (изменения не найдены)

$ git --version
git version 2.21.0
$ git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean

$ git config -l | grep core
core.editor='C:/Program Files (x86)/Notepad++/notepad++.exe' -multiInst -nosession
core.autocrlf=false
core.preloadindex=true
core.fscache=true
core.filemode=true
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.ignorecase=true

Так для обеих оболочек core.filemode=true.

Любые предложения о том, почему gitbash подхватывает изменение разрешения файла?

1 Ответ

0 голосов
/ 21 сентября 2019

Выполните эту команду

git config core.fileMode false

в обоих репозиториях.

См. Как заставить Git игнорировать изменения режима файла (chmod)?

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...