Git 通常会在安装的驱动器上窒息吗?或者只是 Git GUI 的? [英] Does Git generally choke on mounted drives? Or just Git GUI's?

查看:27
本文介绍了Git 通常会在安装的驱动器上窒息吗?或者只是 Git GUI 的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道我应该顽固地在终端中使用 git,但我在 Mac 上使用了一个名为 Sourcetree 的 Git 客户端来让整个事情变得更加性感.

I know I should be diehard and use git in the terminal, but I use a Git client on Mac called Sourcetree to make the whole thing just a bit more sexy.

问题是我添加到我的设置中的新 Synology NAS 驱动器.将 NAS 共享文件夹之一安装在我的 Mac 上后,Sourcetree 在尝试暂存/提交/推送时会卡住.

The problem is a new Synology NAS drive I've added to my setup. With one of the NAS shared folders mounted on my Mac, Sourcetree chokes when trying to stage/commit/push.

我的主分支在 GitHub 上,所以我使用 Sourcetree 将一个 repo 克隆到安装的驱动器.作为快速测试,我编辑了一个不重要的文件,保存并观察了客户端中未暂存的更改.成功至今;编辑后的文件出现在 Sourcetree 的 unstaged 窗口中.我去上演.致命错误:

My master branch is on GitHub, so I cloned a repo to the mounted drive using Sourcetree. As a quick test I edited an unimportant file, saved, and watched for unstaged changes in the client. Success so far; the edited file appears in the unstaged window of Sourcetree. I go to stage it. Fatal error:

git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree add -f -- README.md

git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree add -f -- README.md

致命:无法写入新的索引文件

fatal: Unable to write new index file

已完成,但有错误,见上文

Completed with errors, see above

我查看了隐藏 .git 文件夹中索引文件的文件权限(使用 NAS 目录资源管理器,因为 Mac 不显示隐藏文件.文件权限正在读取, 写入,但不执行.允许执行文件后,使用 Sourcetree 的 stage/commit/push 尝试工作.

I had a look at the file permissions of the index file within the hidden .git folder (using the NAS directory explorer as the Mac doesn't show the hidden file. The file permissions were reading, writing, but not executing. After allowing execution of the file, the stage/commit/push attempts with Sourcetree worked.

显然,我不想每次克隆 git 存储库时都必须手动调整文件权限,所以有人知道为什么 Sourcetree/Git 没有创建具有更有用的文件权限的 repo 克隆吗??

Obviously, I don't want to have to go and manually adjust file permissions every time I clone a git repository, so does anybody have any insight as to why Sourcetree/Git is not creating the repo clone with more helpful file permissions?

为了记录,我在 GitHub OSX 客户端尝试了相同的操作,似乎成功(无需编辑权限).但我觉得 GitHub 客户端有点原始,更喜欢使用 Sourcetree.

For the record, I tried the same operation with the GitHub OSX client, which seemed successful (no need to edit permissions). But I find the GitHub client a little primitive, and would prefer to use Sourcetree.

推荐答案

一般是 git.这个答案表明,这是因为文件锁定.有关更多信息,只需搜索git samba"

It is git in general. This answer suggests, it is because of the filelocking. For more info, just search SO for "git samba"

根据我的经验,在网络驱动器上操作非裸存储库是个坏主意.

From my experience, operating on a non-bare repo on a network drive is a bad idea.

最佳实践:http://git-scm.com/book/ch4-1.html

所以要么:

  1. 在您的 NAS 上设置一个 SSH 服务器并推送/拉到该服务器
  2. 映射您的网络共享(就像您现在拥有的那样),但在其上放置一个裸存储库.然后,推/拉到那个.

在任何情况下,建议将带有工作副本的 git 存储库驻留在本地磁盘上.

In any case it is recommended that the git repo with the working copy resides on a local disk.

这篇关于Git 通常会在安装的驱动器上窒息吗?或者只是 Git GUI 的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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