SouthFox's Garden

Search IconA magnifying glass icon. 搜索

2025-02-25

Git 仓库重定向

如同 Git 使用代理github 加速 clone 提到的一样, insteadOf 还可以设置到 ~/.gitconfig 里全局配置,例如:

[url "https://xxx.yyy/github.com"]
	insteadOf = "https://github.com"

就可以将相关的 github 仓库替换成 https://xxx.yyy/github.com/owener/repo.git 的样式从而无缝使用其它网站进行加速,同时针对 doom emacs ,其默认不使用 gitconfig 文件,可设置 DOOMGITCONFIG 环境变量例如: DOOMGITCONFIG=~/.gitconfig ~/.emacs.d/bin/doom upgrade 来使用特定的 gitconfig 文件来将着一大堆 github 仓库指向访问速度快的地方。

反向链接

    评论