赞
踩
You can significantly speed up Git on Windows by running three commands to set some config options:
git config --global core.preloadindex true
git config --global core.fscache true
git config --global gc.auto 256
Notes:
core.preloadindex
does filesystem operations in parallel to hide latency (update: enabled by default in Git 2.1)
core.fscache
fixes UAC issues so you don’t need to run Git as administrator (update: enabled by default in Git for Windows 2.8)
gc.auto
minimizes the number of files in .git/
备注:可以方式1 方式2 都设置,设置了方式1 感觉提升不大
修改 git 配置文件 profile(我的路径为 C:\Program Files\Git\etc)
添加位置为profile PS1 最后出现位置的下方 我的是
添加内容:
fast_git_ps1 ()
{
printf -- "$(git branch 2>/dev/null | sed -ne '/^\* / s/^\* \(.*\)/ [\1] / p')"
}
PS1='\[\033]0;$MSYSTEM:\w\007
\033[32m\]\u@\h \[\033[33m\w$(fast_git_ps1)\033[0m\]
$ '
这么设置的原因,是因为,git bash 格式化输出、渲染太多,导致执行命令后,反应较慢
执行命令
export PS1='$'
这个设置是 格式化输出替换为 $
符号,速度提升较大 效果如下
卸载-重启-安装,一路next,使用默认配置。(知乎方法,并未尝试)
查看当前系统用户目录
调试 git status 命令
显示耗时
1、Diagnosing performance issues
2、painfully - git status slow
3、installer: offer the builtin stash/rebase as experimental options
4、Git Bash is extremely slow on Windows 7 x64
5、Git commands have a 2-3 second delay before returning to the prompt #1070
6、What is the meaning of these Windows Environment variables: HOMEDRIVE, HOMEPATH, HOMESHARE, USERPROFILE
7、提高win10 系统 git 速度的方法
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。