0

Is there a way to automatically set the execution bit upon committing a new bash script from a Windows machine?

The manual way to do it is git update-index --chmod=+x myscript.sh - but this is typically only done postmortem after the build process fails on the linux box due to missing execute permission on the script.

5
  • You may be able to do it in commit hook. Commented Aug 20, 2023 at 16:58
  • I definitely think it could be done in a commit hook, but then the hook has to be installed manually, which is a different issue. My initial thought is to put a hook on the server that rejects a commit with .sh files not marked executable, but then that creates still a different set of problems. Commented Aug 21, 2023 at 15:06
  • When I said commit hook, I didn't mean rejects a commit with .sh files not marked executable. I wonder if commit hook can enforce the setting of executable bits. Commented Aug 21, 2023 at 15:10
  • Maybe stackoverflow.com/questions/1580596/… could be helpful? Commented Sep 13, 2023 at 9:14
  • 1
    @WyattCarpenter - there's probably the start of an answer in there somewhere. Thanks for the pointer. Commented Sep 14, 2023 at 14:28

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.