views:

74

answers:

3

I have a big repository in a shared folder. I use git from within a VM on that folder. Everything works nice, but the repository is big and git's searching through all directories and files when committing is slow. I cannot move this repository out of the shared folder.

I tried to git add specific files and directories, but when I do git commit -m "something" it still goes off onto it's oddyssey through the directory tree.

Can I do commits that ignore the rest of the tree?

+3  A: 

As an alternative to changing your natural workflow, you could work on a clone that lives in a directory that's private to the VM. Then you push to the repository on the shared folder (which can probably be a bare repository) only when you want to publish your work to the outside environment.

Marcelo Cantos
A: 
git commit <specific-files-and-directories>

maybe? But I don't like the idea of sharing repository on the filesystem. Git is the tool for sharing repository content already.

Michael Krelin - hacker
Ever coded a cross platform app with, say, eclipse cdt under Linux and debugged it with visual studio under win7 with a switch of a window and the pressing of a key? Believe me, working across system barriers like that gave me a cosmos of new possibilities and I am not prepared to give that up.
AndreasT
+2  A: 

You can try enabling the preloadindex option, described in the git-config man page:

core.preloadindex

Enable parallel index preload for operations like git diff

This can speed up operations like git diff and git status especially on filesystems like NFS that have weak caching semantics and thus relatively high IO latencies. With this set to true, git will do the index comparison to the filesystem data in parallel, allowing overlapping IO's.

To turn this on use:

git config core.preloadindex true
Pat Notz
Interesting option. +1
VonC
Cool! I'll definitely try this!
AndreasT