R. Barrett
R. Barrett

Reputation: 859

How To Make A Powershell Script Executable in Git via git update-index

So I am trying to change the Powershell Scripts as executable and commit them as such with an updated index. Is there a way I can do this?

I know in bash it's fairly easy:

sudo chmod +x some_file.sh
git update-index --chmod=+x some_file.sh
git add -A
git commit -a
git push

Any thoughts on how I can do this for Powershell Scripts within Windows Machines?

Upvotes: 0

Views: 266

Answers (1)

krisz
krisz

Reputation: 2696

On Unix, you don't need any special command apart from git add, git can detect the executable bit from the worktree. git diff even lists mode changes.

On Windows, you can use git add --chmod +x file.

You can use git ls-files --stage to see which files are executable.

Upvotes: 1

Related Questions