Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

$ 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.

question from:https://stackoverflow.com/questions/9027584/how-to-change-the-file-mode-on-github

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
214 views
Welcome To Ask or Share your Answers For Others

1 Answer

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.

Update

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...