How can sourcetree windows users set the executable bit on some files before pushing?
It is a common problem if sysadmins use sourcetree on windows to manage scripts (*.sh
, *.py
, and so on) that need to be executable when they're pulled on a remote linux system.
So far, the only solution I've found is to open a Terminal window, and run the command:
git update-index --chmod=+x <your_file>
It seems like this must be a common enough situation to deserve a simpler solution, like right-clicking a file and "set executable" or by some setting in .gitattributes
, but so far, I can't find any solution like that.
I also know you can define a Custom Action, but it's very surprising if something this common truly requires you to put that much effort into setup in advance.
Is there any better solution possible?