git status无法与Virtualbox共享文件夹一起正常使用 [英] git status does not work properly with Virtualbox Shared Folders
问题描述
详细信息
- 主机:macOS Sierra
- 来宾计算机:Ubuntu 64位16.04 LTS
- Virtualbox :5.1.14
在主机上,存储库目前仅位于本地.已初始化,并且具有多个[local]提交,而无需一次按入远程.
症状
在我的主机上,我有parent
文件夹,上面有一个Git存储库.
我已经与来宾计算机共享了parent
文件夹,在VM上登录后,该文件夹位于/media/sf_parent
中.
在终端中,我现在正在执行cd /media/sf_parent
,内容似乎已正确共享.
但是,当我切换到repo
文件夹时,我尝试执行git status
,并且输出结果是跟踪但修改了存储库中的所有单个文件.
奇怪的是,git log
提供了我在主机上所做的最后一次提交.
我试图用ls
直观地比较存储库文件夹的两个版本",它们的更新日期"和文件大小"的值相同,但所有者",组"和权限"的值不同./p>
可能是什么问题?
也许Virtualbox某种程度上不支持此功能?
在文件系统级别上可能与所有者"和权限"发生冲突?
借助 git config的帮助我怀疑能解决此问题,并且 @ g19fanatic 表示此问题似乎与用户权限".
在阅读了页面上的很多属性之后,我测试了这两个属性:
git config core.filemode false
git config core.ignorecase false
PS:它们都是默认的true
.
重新启动VM并使其正常工作,现在工作树已在主机和来宾之间进行了同步.
Details
- Host Machine: macOS Sierra
- Guest Machine: Ubuntu 64bits 16.04 LTS
- Virtualbox: 5.1.14
On the host the repository is only local for now. Initialized and have several [local] commits without a single push to remote.
Symptoms
On my host machine I have parent
folder with a Git repository on it.
I have shared parent
folder with the guest machine, after login on the VM the folder is in /media/sf_parent
.
In a terminal I do cd /media/sf_parent
at the moment the content seems to be properly shared.
But when I change to the repo
folder I tried to do a git status
and the output is as everything single file in the repository is tracked but modified.
The strange part is that the git log
delivers the last commit I have made on host.
I tried to visually compare both "versions" of the repository folder with ls
and they the same value for "update date" and "file size" but have different values for "owner", "group" and "permissions".
What could be the problem?
Maybe Virtualbox somehow does not support this?
Might be the conflict on filesystem level with "owner" and "permissions"?
With the help of git config I was able to resolve this problem as I suspected and @g19fanatic suggested this problem seems to be related with "user permissions".
After reading a lot of the properties on the page I tested this two:
git config core.filemode false
git config core.ignorecase false
PS: Their are both true
as default.
Restarted the VM and it worked, now working tree is synced between host and guest.
这篇关于git status无法与Virtualbox共享文件夹一起正常使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!