Ways to improve git status performance

后端 未结 10 852
遇见更好的自我
遇见更好的自我 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:28

    To be more precise, git depends on the efficiency of the lstat(2) system call, so tweaking your client’s “attribute cache timeout” might do the trick.

    The manual for git-update-index — essentially a manual mode for git-status — describes what you can do to alleviate this, by using the --assume-unchanged flag to suppress its normal behavior and manually update the paths that you have changed. You might even program your editor to unset this flag every time you save a file.

    The alternative, as you suggest, is to reduce the size of your checkout (the size of the packfiles doesn’t really come into play here). The options are a sparse checkout, submodules, or Google’s repo tool.

    (There’s a mailing list thread about using Git with NFS, but it doesn’t answer many questions.)

提交回复
热议问题