设置全局代理git config --global http.proxy https://gitlab.gwlocal.com
git config --global http.proxy # 显示已有的https代理信息:
https://gitlab.gwlocal.com
取消全局代理:git config --global --unset http.proxy
设置局部代理git config --local remote.origin.proxy http://192.168.1.67:88
git config --local remote.origin.proxy
git config --local --unset remote.origin.proxy
如果你学会 stash,就不用那么狼狈了。你只需要:
git stash
就这么简单,代码就被存起来了。
当你修复完线上问题,切回 feature 分支,想恢复代码也只需要:
git stash apply
# 保存当前未commit的代码
git stash
# 保存当前未commit的代码并添加备注
git stash save "备注的内容"
# 列出stash的所有记录
git stash list
# 删除stash的所有记录
git stash clear
# 应用最近一次的stash
git stash apply
# 应用最近一次的stash,随后删除该记录
git stash pop
# 删除最近的一次stash
git stash drop
当有多条 stash,可以指定操作stash,首先使用stash list 列出所有记录:
$ git stash list
stash@{0}: WIP on ...
stash@{1}: WIP on ...
stash@{2}: On ...
应用第二条记录:
$ git stash apply stash@{1}
pop,drop 同理。