Git 的常见工作流程
1. 单人工作流:
2. 团队协作工作流:
更改密码后 如果您需要更改密码,请先清除存储的旧密码:
shellgit credential reject
避免 pull
时需要多次输入账号信息 配置全局 credential.helper
为 store
:
shellgit config --global credential.helper store
【或者】在 .gitconfig
或 config
文件中确认以下内容已写入:
text[credential] helper = store
处理 VPN 代理问题 如果使用 VPN 导致访问异常,可尝试以下操作诊断并修复:
刷新 DNS 缓存
shellipconfig /flushdns
查看当前代理配置
shellgit config --global http.proxy git config --global https.proxy
设置 HTTP 和 HTTPS 代理 根据 VPN 工具的端口配置代理:
HTTP 代理(如 Clash 的默认端口 7890):
shellgit config --global http.proxy http://127.0.0.1:<端口号> git config --global https.proxy https://127.0.0.1:<端口号>
SOCKS5 代理:
shellgit config --global http.proxy socks5://127.0.0.1:2333 git config --global https.proxy socks5://127.0.0.1:2333
取消代理设置 如果不再需要代理,可取消配置:
shellgit config --global --unset http.proxy git config --global --unset https.proxy
本文作者:Freed
本文链接:
版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!