Ways to improve git status performance

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

    Try git gc. Also, git clean may help.

    UPDATE - Not sure where the down vote came from, but the git manual specifically states:

    Runs a number of housekeeping tasks within the current repository, such as compressing file revisions (to reduce disk space and increase performance) and removing unreachable objects which may have been created from prior invocations of git add.

    Users are encouraged to run this task on a regular basis within each repository to maintain good disk space utilization and good operating performance.

    I always notice a difference after running git gc when git status is slow!

    UPDATE II - Not sure how I missed this, but the OP already tried git gc and git clean. I swear that wasn't originally there, but I don't see any changes in the edits. Sorry for that!

提交回复
热议问题