Windows下为git仓库文件添加执行权限的方法

众所周知,在linux下需要为文件添加执行权限,才可以当做可执行文件调用,
不论是二进制文件,还是脚本类文件(bash、python…)。
这可以通过chmod +x someFile来完成。
但win下没有chmod命令该怎么办呢

git2.9起:

1
git add --chmod=+x path/to/file

或者也可以先添加再update-index

1
2
git add path/to/file
git update-index --chmod +x path/to/file
Donate
  • Copyright: Copyright is owned by the author. For commercial reprints, please contact the author for authorization. For non-commercial reprints, please indicate the source.

请我喝杯咖啡吧~

支付宝
微信