Steven Penny Steven Penny - 3 months ago 46
Git Question

How to change the File Mode on GitHub?

$ git add test-file

$ git commit -m 'first commit'
create mode 100644 test-file

$ git push

$ git update-index --add --chmod=+x test-file

$ git commit -m 'change mode'
mode change 100644 => 100755 test-file

$ git push

After that if you go to GitHub it still shows as 100644 no matter what.


MSYS is not the problem. Even if MSYS chmod doesnt work (it doesnt), Git has a built in way of getting around that problem, ie git update-index --chmod=+x. Let it be clear that git update-index only messes with the index (staging area), not the local repository (working directory).

I am convinced the problem is with GitHub. On GitHub if a file is initially pushed with mode 100775, all is well. If a file is initially pushed as 100644 it causes a problem. Attempts to change the file mode will succeed with git add, succeed with git commit, succeed with git push, and even show up in the GitHub file history, but not be reflected on the "blob/master" page on GitHub.


From: Petros Amiridis (GitHub Staff)

Subject: How to change FIle Mode on GitHub?

I have some good news. Our awesome team has just confirmed it is a caching bug on our end. Our team has deployed a fix.