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?
I ended up creating a custom action.
From the menu, select "Tools", "Options"
In the dialog window, select the "Custom actions" tab
In the "Custom Actions" panel, press the "Add" button
In the "Edit custom action" dialog:
From now on, you can mark a committed file as executable while selecting it and applying the custom action.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With