Windows上的Git文件权限 [英] Git file permissions on Windows

查看:497
本文介绍了Windows上的Git文件权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已阅读了一些关于Git中文件权限的问题,但我仍然有点困惑。我在GitHub上从另一个版本获得了一个回购。合并后,他们应该是相同的。但是:
$ b $ pre $ code $ git diff --summary origin / epsilon master / epsilon
mode change 100644 => 100755 ants / dist / sample_bots / csharp / compile.sh
模式更改100644 => 100755 ants / dist / starter_bots / coffeescript / MyBot.coffee
模式更改100644 => 100755 ants / dist / starter_bots / coffeescript / ants.coffee
模式改变100644 => 100755 ants / util / block_test.sh
模式更改100644 => 100755 manager / mass_skill_update.py
模式更改100644 => 100755 worker / jailguard.py
模式更改100644 => 100755 worker / release_stale_jails.py
模式更改100644 => 100755 worker / start_worker.sh

我试过更改文件权限,但它不会改变diff结果。



我应该怎么做?

编辑:导致此问题/由于我在共享Windows 7主机上托管repo的ubuntu VM guest虚拟机上使用git这一事实。这是一场灾难。这里的答案对我来说似乎是合理的,但我不能给予打勾,因为他们回答了我没有的问题。

解决方案

我找到了如何在Windows上更改权限(以及)的解决方案: http://blog.lesc.se/2011/11/how-to-change-file-premissions-in-git.html



例如,以下命令将用户执行权限添加到任意文件中:

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


I've read through a few questions regarding file permissions in Git and I'm still a bit confused. I've got a repo on GitHub forked from another. Post merge, they should be identical. However:

$ git diff --summary origin/epsilon master/epsilon
 mode change 100644 => 100755 ants/dist/sample_bots/csharp/compile.sh
 mode change 100644 => 100755 ants/dist/starter_bots/coffeescript/MyBot.coffee
 mode change 100644 => 100755 ants/dist/starter_bots/coffeescript/ants.coffee
 mode change 100644 => 100755 ants/util/block_test.sh
 mode change 100644 => 100755 manager/mass_skill_update.py
 mode change 100644 => 100755 worker/jailguard.py
 mode change 100644 => 100755 worker/release_stale_jails.py
 mode change 100644 => 100755 worker/start_worker.sh

I've tried changing file permissions, but it does not alter the diff results.

What should I do?

edit: this problem was caused/compounded by the fact that I was using git on an ubuntu VM guest with the repo hosted on the shared Windows 7 host. This was a recipe for disaster. The answers here seem reasonable to me, but I cannot award a tick because they answer a problem which I didn't have.

解决方案

I found the solution of how to change permissions (also) on Windows here: http://blog.lesc.se/2011/11/how-to-change-file-premissions-in-git.html

For example following command adds user execute permission to an arbitrary file:

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

这篇关于Windows上的Git文件权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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