Git 配置指定域名代理

命令行配置 全局代理配置 git config --global http.proxy socks5://127.0.0.1:1080 git config --global https.proxy socks5://127.0.0.1:1080 指定特定域名代理 git config --global https.https://github.com.proxy socks5://127.0.0.1:1080 重置代理 git config --global --unset https.https://github.com.proxy 直接修改配置文件 [http "https://github.com"] proxy = socks5://127.0.0.1:1080 [https "https://github.com"] proxy = socks5://127.0.0.1:1080

March 25, 2020 · 1 min · lyincc

Git 命令行使用

安装 Git For Windows in MSYS2 https://github.com/git-for-windows/git/wiki/Install-inside-MSYS2-proper 概念 The Refspec (引用指定) [+]<src>:<dst> [+] # 强制更新 <src> # 本地引用 <dst> # 远端引用 表示本地分支和远端分支的映射关系 拉取引用 通常.git/config中会默认指定这个映射,在fetch或是pull时会使用该映射。 [remote "origin"] url = git@github.com:schacon/simplegit-progit.git fetch = +refs/heads/*:refs/remotes/origin/* 修改该映射该映射可以使得默认的fetch或是pull命令获取指定分支。 [remote "origin"] url = git@github.com:schacon/simplegit-progit.git fetch = +refs/heads/master:refs/remotes/origin/master fetch = +refs/heads/experiment:refs/remotes/origin/experiment 同时指定多个引用也是允许的。 推送引用 通过相同的方法,也可以修改push命令的默认行为。 [remote "origin"] url = git@github.com:schacon/simplegit-progit.git fetch = +refs/heads/*:refs/remotes/origin/* push = refs/heads/master:refs/heads/qa/master 这里的远程分支用到了名为qa的命名空间。 删除引用 git push origin :topic 通过留空的引用,删除topic分支...

December 24, 2018 · 4 min · lyincc