Git Status Takes a Long Time to Complete

后端 未结 13 598
一整个雨季
一整个雨季 2020-12-12 20:32

I\'m using git to manage files in a local directory on a Windows machine - no network is involved here, I\'m not pushing or pulling to/from another machine. My

相关标签:
13条回答
  • 2020-12-12 20:33

    On a similar issue I found that having a git repo in a directory below my existing git repo caused a massive slow down.

    I moved the secondary git repo somewhere else and now the speed is fast!

    0 讨论(0)
  • 2020-12-12 20:33

    For me, the slowness was due to having a lot of untracked files (temporary and output files from scripts.) Running git status -uno, which excludes the untracked files, ran much faster, and meets my requirements

    0 讨论(0)
  • 2020-12-12 20:33

    The issue for me was that I had a lot of different repositories cloned onto my local hard drive, the more repos you have the longer it will take to run commands like git status.

    I simply deleted a lot of the repos which I no longer needed locally, and my git status went from 1minute~ to 5 seconds.

    I can't see any answers similar to this here.

    0 讨论(0)
  • 2020-12-12 20:36

    Have you tried repacking? git-repack.

    Otherwise, try duplicating the directory, and deleting the .git folder in the duplicated directory. Then create a new git directory and see if it's still slow.

    If it's still slow, then it sounds like a system or hardware issue. Git finishes status on hundreds of files for me in less than 5 seconds.

    0 讨论(0)
  • 2020-12-12 20:41

    Running git fsck has resolved this issue for me in the past.

    0 讨论(0)
  • 2020-12-12 20:42

    My git status was very slow (up to one minute), because the global .gitignore file was located in my windows userprofile, which was stored on an inaccessible network share.

    git config --global core.excludesfile
    showed something like \\Nxxxx0\User\Username\Eigene Dateien\gitignore_global.txt

    For some reason \\Nxxxx0 was inaccessible and my userprofile was loaded from a backup system \\Nxxxxx1. It took some time to figure that out, because usually my userprofile is bound to a drive letter by an enterprise startup script and accessing that drive letter was working as usual. I'm not sure why the git-config used the network share and not the drive letter (probably a younger me is to blame)

    After setting
    git config --global core.excludesfile $HOME/Eigene\ Dateien/gitignore_global.txt
    git status was back to normal speed.

    0 讨论(0)
提交回复
热议问题