4

I am working on a project that requires me to run Ubuntu as a dev server on VirtualBox from my main Windows machine. I have a common shared folder between Windows and Ubuntu VBox. The project is built in Yii PHP, and I work mostly on the front-end code. Git is installed on Ubuntu and I am able to successfully pull from the project's github repository. However, the problem lies when I try to commit to git.

When I type the command "git add -A", I get the following error:

error: unable to write sha1 filename
.git/objects/e6/54703eed28d60e6f607eda24ffd2048bca83a6: Text file busy

error: framework/i18n/data/ne_np.php: failed to insert into database
error: unable to index file framework/i18n/data/ne_np.php
fatal: updating files failed

I have tried many work-arounds, including the command:

git config --add core.shareRepository group

But I also end up with a similar error.

Does anyone have any idea of what could be causing this? Thanks.

1
  • I wouldn't use a shared folder that's a git repository between windows and ubuntu in VBox. Why aren't you just using git on windows an git on ubuntu and push/pull on both sides? -- edit -- What causing this - is the fact that file is probably used by your other OS, or there's simply a permission problem.
    – favoretti
    Nov 30, 2011 at 2:29

2 Answers 2

2

Using git in synchronised folders like Dropbox or this is generally a bad idea – git seems to assume that nobody else tries to touch a repo concurrently, doesn't try to perform sets of filesystem operations atomically, and you get race conditions like this.

Don't put git repos into automatically synced folders. Synchronise the host and the VM by pushing/pulling to your github fork.

2

Do not try to share your repository. Do a clean checkout on the VM and Windows host. Git is not designed to be shared like this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.