You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to official documentation I cannot find how .gitattributes could support chmod permissions.
Windows OS has some flaws and does not properly support executable permissions:
So in git-bash I can do
chmod a+x my-script.sh
But it more or less does nothing at all.
As a result when adding scripts to git, I have to do things like this:
git add --chmod=+x my-script.sh
Or after adding
git update-index --chmod=-x my-script.sh
Otherwise the script will not work on Linux or Mac that have proper chmod support in their OS and FS.
What would be an obvious feature is to add something like this to my .gitattributes:
*.sh chmod=+x
Then my expectation would be that git add my-script.sh would implicitly do git add --chmod=+x my-script.sh just like other tweaks done via .gitattributes.
Why is that now working?
Is that by design?
Or because nobody ever thought of this feature and you would even consider implementing it?
p.s. forgive me if this may be the wrong place in case it would need to be implemented somewhere in git-core but as a github user this discussion here was the best place to get. And BTW mailing lists are IMHO very 80ties.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
According to official documentation I cannot find how
.gitattributes
could supportchmod
permissions.Windows OS has some flaws and does not properly support executable permissions:
So in git-bash I can do
But it more or less does nothing at all.
As a result when adding scripts to git, I have to do things like this:
Or after adding
Otherwise the script will not work on Linux or Mac that have proper chmod support in their OS and FS.
What would be an obvious feature is to add something like this to my
.gitattributes
:Then my expectation would be that
git add my-script.sh
would implicitly dogit add --chmod=+x my-script.sh
just like other tweaks done via.gitattributes
.Why is that now working?
Is that by design?
Or because nobody ever thought of this feature and you would even consider implementing it?
p.s. forgive me if this may be the wrong place in case it would need to be implemented somewhere in git-core but as a github user this discussion here was the best place to get. And BTW mailing lists are IMHO very 80ties.
Beta Was this translation helpful? Give feedback.
All reactions