Add Executable Permissions to Shell Scripts in Window Git
When adding a shell script into Git, sometimes, it's need to add executabe permission for it. In Linux like system, it's very easy, as we can run chmod +x <file>
, then push to Git repository as usual. But it's not possible in Windows with same way.
However, it's possible to use command git update-index
to add permission. * Check if a file has executabe Permissions
Run git ls-files --stage | grep foo.sh
, it will show as,
644
, doesn't have executabe permission * Add executabe permission for the files Run git update-index --chmod=+x foo.sh
, then run above command will show as,