Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to chmod 0777 a file and commit as is to Git on Windows?

Tags:

I'm working on Windows and on the production there's a Linux system and I'd like to chmod some files to 0777, but I don't know how to do it on Windows. I rather not do it on production, because I'm unable to commit/push there.

Is there a way to chmod 0777 a file on Windows and commit it to Git so that it stays 0777 when I clone/pull on the production?

like image 633
Tower Avatar asked Nov 19 '12 13:11

Tower


People also ask

How do I give git permission in Windows?

Open Project settings>Repositories. To set the permissions for all Git repositories, choose Security.

What does chmod 0777 do?

It means to make the file readable, writable and executable by everyone with access.


1 Answers

If you want to mark the file as executable, you can use

git update-index --chmod=+x <your_file> 

If you really want to have the file writable for everyone, you would have to set up a post-update hook on the linux system, because git does not track file permissions, only the executable bit.

like image 134
crater2150 Avatar answered Sep 29 '22 14:09

crater2150