I changed permissions of some files locally and pushed it to GITHUB without having the config.FileMode flag = false in my gitconfig. So GIT Pushed the file mode changes but I want to revert those file mode changes from 100755 to 100644.I am using a MAC osx as my development environment. I don't want to use git reset --hard HEAD on my repository. Any suggestions ?
Asked
Active
Viewed 2.5k times
6
-
You would need to do `git reset --hard HEAD~` to revert committed changes. – Joseph K. Strauss Feb 02 '15 at 04:14
-
Possible duplicate of [How do I remove files saying "old mode 100755 new mode 100644" from unstaged changes in Git?](https://stackoverflow.com/questions/1257592/how-do-i-remove-files-saying-old-mode-100755-new-mode-100644-from-unstaged-cha) – hyiltiz Aug 02 '17 at 20:00
2 Answers
10
In my case just changing the permission manually from 755 to 644 worked and pushing it again to GITHUB.
chmod 644 <filename>
GIT will list this file in the diff and you can simply commit and push it to your repository on GITHUB.

psbits
- 1,787
- 5
- 19
- 34
-
I want to do this for all files in my repo but keep the executable files executable. – Boris Verkhovskiy Mar 31 '23 at 20:10
1
I changed permission of my files manually from 755 to 644 using the below mentioned command and pushed the files again.
chmod -x <file_name>
After pushing the files, I changed core.filemode
config to false so that permission of other files don't get changed.

Shilpi
- 31
- 4