Next to that, on Windows the file permissions for running scripts and executables do not matter that much as windows simply can execute whatever is readable but that is of course different on Linux or *nix like systems where file permissions are needed to be able to execute scripts, like bash scripts (*.sh).
In our git repositories we are also maintaining the bash scripts for dockerizing builds that run in Jenkins and unfortunately, copying over a script to another git repo on a windows machine suddenly might give the script different permissions. Resulting in the script failing with a nasty execute permission error within Jenkins. That is, the script might not be having the execute permissions.
What to do is to add the execute permission to the script. But how to do that on windows?
git ls-tree HEAD will show the permissions for each file of the path you are in. In the above example the permissions are still 644, so not executable.
git ls-files –stage shows the staged change. 755 has added the execute permission.
After committing this script, jenkins will execute this docker.sh script just fine.
You don’t need a mac to update file permissions for *nix based bash scripts; you can do that on Windows as well, it’s just about running some *nix like commands via the git command.