Git file permissions on Windows

后端 未结 6 2028
清歌不尽
清歌不尽 2020-12-04 04:58

I\'ve read through a few questions regarding file permissions in Git and I\'m still a bit confused. I\'ve got a repo on GitHub forked from another. Post merge, they should b

6条回答
  •  无人及你
    2020-12-04 05:26

    First check file permissions using below command.

    git ls-files --stage
    

    Then change permissions. Here "x" represents execute permissions.

    git update-index --chmod=+x 'scriptname.ext'
    

    Now re-verify the permissions.

    git ls-files --stage

    ==============================================

    if you are using Windows PC, but deploying on linux machine. Execute the below command in the first place to make it compatible to run on linux machine

    dos2unix scriptname.ext scriptname.ext

提交回复
热议问题