I do all of my primary development work on a Windows computer that runs several Vagrant VMs. The other day I needed to add an executable to my repo and have it be automatically marked as an executable file on all the servers (this project isn’t running Ansible yet so it’s not an option).

If I was running a fully Linux development environment I could just do the following:

chmod +x /path/to/file
git add /path/to/file
git commit -m "Added file"

But this doesn’t work because of the way Virtual Boxes virtual folders work. In order to do this I need to run the following in Windows:

git update-index --chmod=+x /path/to/file

Then I can commit the file and it will be marked as executable when it gets git pulled to the server.