How to change the File Mode on GitHub?

前端 未结 2 1587
深忆病人
深忆病人 2021-01-31 03:04
$ git add test-file

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

$ git push

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


        
2条回答
  •  旧时难觅i
    2021-01-31 03:37

    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.

提交回复
热议问题