1

I have virtual box with installed arch linux. Host system is windows 10. I have mounted disc via virtual-box quest utills. From VM level I clone repository inside shared windows/linux space. Clone is done with success. But creating some files in working directory provide some errors: (gcc repository)

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.

If any information is needed, please ask.

jww
  • 97,681
  • 90
  • 411
  • 885
Robert Pawlak
  • 529
  • 7
  • 23
  • Are you cloning the repo on Linux and Windows separately? Or you have a shared folder where you cloned it and Windows and Linux both use it ? – Chetan Mar 24 '19 at 23:08
  • Exactly the second way, i have shared directory, cloned repo (via linux client). And just both system can use and modify this repository – Robert Pawlak Mar 24 '19 at 23:16
  • That might be the issue as systems will find files being locked by other system. And that will not allow add it delete files to that share location. Not exactly same as yours but people have faced similar issues [here](https://stackoverflow.com/questions/11774397/git-push-error-unable-to-unlink-old-permission-denied) and [here](https://stackoverflow.com/questions/16764946/what-generates-the-text-file-busy-message-in-unix) – Chetan Mar 24 '19 at 23:21
  • 1
    Possible duplicate of [Git Symlinks in Windows](https://stackoverflow.com/q/5917249/608639), [Add symlink file as file using Git on Windows](https://stackoverflow.com/q/30616779/608639), [How to add symlinks to git repository on Windows?](https://stackoverflow.com/q/31232829/608639), etc. – jww Mar 25 '19 at 01:25

1 Answers1

6

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.

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). 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.

bk2204
  • 64,793
  • 6
  • 84
  • 100
  • “Separate clone”. - I know this is picky, but git terminology should be preferred when talking about git. – evolutionxbox Mar 24 '19 at 23:33
  • 1
    Thanks for the answer. I always use this way of work, Editing in windows editor, and building via ssh conected linux. The only change which was needed is just change EOL in git config. And now when i want clone gcc or linux official repo it occurs this strange issues. I think there must be some solution. Please note this, that during first checkout (when files are "spawn" in working directory) none of the files is modified by windows. – Robert Pawlak Mar 25 '19 at 00:14
  • @RobertPawlak Did you find a solution? – sola Oct 19 '20 at 12:20
  • 1
    @sola yes, i found, i abandon virtual-box mechanism with mounting shared directory, and just use sshfs, and windows mechanism to map network drive. Solution with sshfs is better beacuse i can map also linux root/user directory as network drive – Robert Pawlak Oct 19 '20 at 21:29
  • @RobertPawlak - how did you overcome the path issues between the windows and unix git commands, or are you only using the git commands from one OS? – Brandon Langley Feb 05 '21 at 22:31