如何chmod 0777文件并提交到Windows上的Git? [英] How to chmod 0777 a file and commit as is to Git on Windows?

查看:174
本文介绍了如何chmod 0777文件并提交到Windows上的Git?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows上工作,在生产上有一个Linux系统,我想chmod一些文件到0777,但我不知道如何在Windows上做到这一点。我不是在做生产,因为我无法提交/推在那里。

有没有办法在Windows上chmod 0777文件并将其提交给Git所以当我克隆/拉生产时它保持0777?如果你想将文件标记为可执行文件,可以使用

$ p $ g $ update-index --chmod = + x

如果你真的想让这个文件对于每个人都是可写的,你必须设置一个 post-update 钩在linux系统上,因为git不跟踪文件权限,只有可执行位。


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?

解决方案

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.

这篇关于如何chmod 0777文件并提交到Windows上的Git?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆