mac之开发中的环境配置
git
ping github.com
解决githubcom访问慢
https://blog.csdn.net/yh0503/article/details/90233216
GitHub.com域名查询
https://site.ip138.com/github.com/
访问网址http://github.com.ipaddress.com/,分别获取github.com、github.global.ssl.fastly.net对应的IP
github.com,192.30.253.112 192.30.253.113
assets-cdn.github.com,101.184.133
global.ssl.fastly.net,151.101.185.194
编辑文件
git config --edit --global
设置Git缓存值大小 1048576000
sudo git config --global http.postBuffer 524288000
sudo git config --global https.postBuffer 524288000
git config --list 查看设置值
sudo git config --global http.postBuffer 1048576000
sudo git config --global https.postBuffer 1048576000
git config http.postBuffer 1048576000
需要注意的是http.postBuffer 后,单位是b,524288000B也就500M左右
然后增加最低速度时间
git config --global http.lowSpeedLimit 0
git config --global http.lowSpeedTime 999999
git config http.postBuffer 524288000
//或全局设置
git config --global http.postBuffer 524288000.
git clone --depth=1 http://xxx.git
git fetch --unshallow
home brew
Mac 解决 Homebrew 一直卡在 update
https://www.jianshu.com/p/77c60428569d
https://blog.csdn.net/weixin_36562804/article/details/107872131
mac
下 Homebrew 可能会在install
或者update
的时候会很慢,卡很久。
两种方式来解决:
一、直接关闭brew
执行命令时的自动更新
# 1. 编辑配置文件
vim ~/.bash_profile
# 2. 文件内新增一行
export HOMEBREW_NO_AUTO_UPDATE=true
# 3. 重新加载配置文件
source ~/.bash_profile
二、替换brew
源
cd "$(brew --repo)"
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
#替换homebrew-core.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
brew update
# 备用地址-1
cd "$(brew --repo)"
git remote set-url origin https://git.coding.net/homebrew/homebrew.git
brew update
# 备用地址-2
cd "$(brew --repo)"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/brew.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew-core.git
brew update
PS:官方默认信息
# 1. 重置brew.git
cd "$(brew --repo)"
git remote set-url origin https://github.com/Homebrew/brew.git
# 2. 重置homebrew-core.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://github.com/Homebrew/homebrew-core.git