Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git can I speed up committing?

Tags:

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?

like image 819
AndreasT Avatar asked May 20 '10 09:05

AndreasT


People also ask

How long should git commit take?

Expected behavior: commit in the usual timeframe, usually under 10 seconds, even for large commits. Actual behavior: commit takes 5 minutes or more.

Should I pull before or after committing?

If you have uncommitted changes, the merge part of the git pull command will fail and your local branch will be untouched. Thus, you should always commit your changes in a branch before pulling new commits from a remote repository.


1 Answers

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 
like image 130
Pat Notz Avatar answered Sep 25 '22 00:09

Pat Notz