Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

У .sh скрипта меняются права на Ubuntu, что отображается в Changes not staged for commit #3

Open
artemijkurganov opened this issue Oct 8, 2023 · 0 comments

Comments

@artemijkurganov
Copy link

> ls -la
-rwxr-xr-x  1 kurganov kurganov  499 Oct  8 14:33 apply-gitconfig-for-nix.sh*
  • Открываем проект в VS Code
> ls -la
-rw-r--r--  1 kurganov kurganov  499 Oct  8 14:35 apply-gitconfig-for-nix.sh

У файла поменялись права, поэтому файл отобразится в Changes not staged for commit

> 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 restore <file>..." to discard changes in working directory)
        modified:   apply-gitconfig-for-nix.sh
> git diff apply-gitconfig-for-nix.sh
diff --git a/apply-gitconfig-for-nix.sh b/apply-gitconfig-for-nix.sh
old mode 100755
new mode 100644

Файл будет постоянно отображаться в Changes not staged for commit, что может сбить с толку студентов, впервые изучающих git. Быстро проблему решает команда git config core.filemode false:

https://stackoverflow.com/questions/1257592/how-do-i-remove-files-saying-old-mode-100755-new-mode-100644-from-unstaged-cha

Скорее всего, какой-то конфликт wsl2 и VS Code на винде

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant