git 在 GITHUB 上将文件模式权限从 100755 更改为 100644
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/28268842/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Changing File Mode permissions from 100755 to 100644 on GITHUB
提问by psbits
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 ?
我在本地更改了某些文件的权限并将其推送到 GITHUB,而我的 gitconfig 中没有 config.FileMode 标志 = false。所以 GIT 推送了文件模式更改,但我想将这些文件模式更改从 100755 恢复到 100644。我使用 MAC osx 作为我的开发环境。我不想在我的存储库上使用 git reset --hard HEAD。有什么建议 ?
回答by psbits
In my case just changing the permission manually from 755 to 644 worked and pushing it again to GITHUB.
在我的情况下,只需手动将权限从 755 更改为 644 即可,并将其再次推送到 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.
GIT 会在 diff 中列出这个文件,你可以简单地提交并将它推送到你在 GITHUB 上的存储库。