Now and then I put a deploy.sh
file in my repositories. It’s useful when I have to work elsewhere than on a Forge server.
When you create an executable file like this and commit it to your repository, by default it is not executable on the server because Git doesn’t commit file permissions by default.
The solution is 4 commands :
git update-index --chmod=+x deploy.sh
git ls-tree HEAD
git commit -m "Make deploy.sh executable"
git push
Now the next time you’ll pull your changes to your server, you’ll be able to run the ./deploy.sh
script.