只对 github.com 开启代理

socks5h:// 中的 “h” 意思是在代理端使用远程 DNS,而不是你的本地 DNS。(懂得都懂, 刚才一直推送不上代码,烦)

git config --global http.https://github.com.proxy socks5h://127.0.0.1:1080

Git 使用 macOS 钥匙串保存密码

git config --global credential.helper osxkeychain

修复 EFI 分区错误

sudo fsck_msdos /dev/disk0s1

npm 代理设置

proxy=http://127.0.0.1:1081
https-proxy=http://127.0.0.1:1081

curl 代理设置

nano ~/.curlrc

针对 HTTP 代理:

proxy = http://127.0.0.1:1081

针对 SOCKS5 代理:

proxy = socks5://127.0.0.1:1080

homebrew 会忽略 curl 的配置文件,可以在 .zshrc 里面配置一个环境变量加载之

export HOMEBREW_CURLRC="~/.curlrc"

macOS 解除应用的隔离属性

sudo xattr -rd com.apple.quarantine 应用路径

git 强制提交子树

如果使用 git subtree push 命令加上 -f 参数来强制提交子树的话, 会提示错误 unknown option f

我们可以使用 git 命令链来解决这个问题, 命令如下

git push <remote> `git subtree split --prefix <local-folder> <local-branch>`:<remote-branch> --force