Ways to improve git status performance

后端 未结 10 868
遇见更好的自我
遇见更好的自我 2020-12-02 06:51

I have a repo of 10 GB on a Linux machine which is on NFS. The first time git status takes 36 minutes and subsequent git status takes 8 minutes. Se

10条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-02 07:11

    I'm also seeing this problem on a large project shared over NFS.

    It took me some time to discover the flag -uno that can be given to both git commit and git status.

    What this flag does is to disable looking for untracked files. This reduces the number of nfs operations significantly. The reason is that in order for git to discover untracked files it has to look in all subdirectories so if you have many subdirectories this will hurt you. By disabling git from looking for untracked files you eliminate all these NFS operations.

    Combine this with the core.preloadindex flag and you can get resonable perfomance even on NFS.

提交回复
热议问题