Updating file permissions with git-bash on Windows 7

前端 未结 2 1249
迷失自我
迷失自我 2020-12-07 22:25

How do I update file permissions with git-bash on Windows 7?

I\'ve tried the following without success:

$ ls -al scripts/script.sh
-rw-r         


        
2条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-07 23:07

    You are probably using NTFS or FAT32 on Windows, and those filesystems do not support the executable permission. Instead, cygwin looks at the file name and contents to determine whether it's executable:

    Files are considered to be executable if the filename ends with .bat, .com or .exe, or if its content starts with #!.

    So you should make sure that the bash file starts with a shebang (e.g. #!/bin/bash). Then, you should be able to just execute the file, disregarding the permission output of ls.

提交回复
热议问题