-
Notifications
You must be signed in to change notification settings - Fork 2.6k
file mode (file permission) is not respected #2015
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
Comments
On Windows, don't change the filemode settings from the discovered true setting. Windows does not have the Linux file modes, so the Git setting must always be done via the index record. |
|
It was set to false initially, but after doing changes to one executable file, its filemode changed to 644, so I had to set it back to 755 with another commit. Now, I edited this file again and the file mode didn't changed to 644. It stayed as it was (755), so everything is good. Will see in the future... Thanks. |
Just to say that Git itself does not store all the bits, only those that matter. Have a check of the manuals. https://git-scm.com/docs/git-config#git-config-corefileMode https://github.com/git/git/blob/master/Documentation/technical/index-format.txt L71-72
|
Again, I made changes to the same executable via my editor (vscode) and the file mode was changed back to 644. This time the change did not come directly from my editor, as the previous one that went fine. I was able to set the mode back to 755 using All this time git was/is set to ignore permission changes... Any clue? Do I have to change the file mode back to 755 every time I edit my file? Thanks! |
git ls-files -s ## will show how git recorded the file (config.sh in your case) ls ## will show what the file system has. |
I am not sure I follow you...
All this time my git installation is set to ignore file mode changes. So how does git ignore file mode changes if it's acting like this? |
That most likely means that the file was added by the merged branch, that you at some stage did the equivalent of |
I see. Then I'll have to re-set the file mode to 755 manually after editing and before committing. Thanks for the replies. |
Setup
defaults?
to the issue you're seeing?
I have WSL (windows subsystem for linux) installed, but the issue I have is outside of WSL.
Details
MINGW64
Minimal, Complete, and Verifiable example
this will help us understand the issue.
** insert here **
The issue I have is related to the file mode (755) for executable files...
I am working on a linux git repo from windows 10. The repo contains some .sh files (executables).
When I set the "filemode = true" option in the git repo config, I always see the following:
If I change the file mode back to 755, commit the changes and push to the online repo (github), the files there will have the correct (755) mode.
But the next time I open the "git gui" application, the file mode for all files is changed again to 644 and I see the same thing as in the photo above. If I choose to "revert changes" it doesn't do anything. The file mode remains changed.
I tried commands like:
but I had no success. Git has all .sh files in my repo listed with 755 mode. I confirmed with the following command:
Setting git to ignore the file mode changes (by setting "filemode = false" in the config) is not a solution because when I want to make changes to the content of these executable files, they will committed with their mode (permissions) changed as well.
So, how can I make git to ACTUALLY remember the file mode???
URL to that repository to help us with testing?
** insert URL here **
The text was updated successfully, but these errors were encountered: