简体   繁体   English

如何在Linux和Windows之间使用git repo

[英]How to work with git repo between linux and windows

I have virtual box with installed arch linux. 我有安装Arch Linux的虚拟盒子。 Host system is windows 10. I have mounted disc via virtual-box quest utills. 主机系统是Windows10。我已经通过虚拟盒任务工具安装了光盘。 From VM level I clone repository inside shared windows/linux space. 从VM级别,我将存储库克隆到共享的Windows / Linux空间中。 Clone is done with success. 复制成功。 But creating some files in working directory provide some errors: (gcc repository) 但是在工作目录中创建一些文件会带来一些错误:(gcc存储库)

error: unable to unlink old 'fixincludes/tests/base/ctype.h': Interrupted system call
error: unable to create file gcc/ada/libgnat/a-chacon.ads: File exists

error: unable to unlink old 'fixincludes/tests/base/sundev/vuid_event.h': Text file busy

In both git client (host and virtual) i have set longpaths to true. 在git客户端(主机和虚拟客户端)中,我都将longpaths设置为true。

If any information is needed, please ask. 如果需要任何信息,请询问。

It isn't generally a good idea to work on the same non-bare repository (that is, using the same directory) between two different systems using a shared drive. 通常,使用共享驱动器在两个不同系统之间的同一个非裸存储库(即,使用相同目录)上工作不是一个好主意。 Remote file systems, even systems like you're using with Virtualbox, don't tend to provide the richness of locking and functionality that Git wants to use, and this is especially true when you're sharing between Windows and Linux. 远程文件系统,甚至像您正在使用Virtualbox的系统一样,也不会提供Git想要使用的丰富的锁定和功能,当在Windows和Linux之间共享时,尤其如此。

It's better to use a separate clone on Windows and Linux and use a shared bare repository that you can push and pull from on demand (and not at the same time). 最好在Windows和Linux上使用单独的克隆,并使用共享的裸存储库,您可以根据需要(而不是同时)从中推送和提取。 This will prevent the mandatory locking that Windows programs do on many files from interfering with your Linux checkout, which is part of what looks like is occurring here. 这将防止Windows程序对许多文件执行的强制锁定干扰您的Linux检出,这是此处发生的情况的一部分。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM