一些零碎的Git操作记录 - Git bits

老是要忘记东西,看来还是要记下来。

拉取子仓

  • 如果首次克隆仓库及其模块,使用:
1
git clone --recursive 仓库地址
  • 对于仓库首次拉取模块,可以使用:
1
git submodule update --init --recursive
  • 更新子模块(适用于git 1.8.2及以上版本)
1
git submodule update --recursive --remote
  • 更新子模块(适用于git 1.7.3及以上版本)
1
git submodule update --recursive

或者

1
git pull --recurse-submodules

代理相关

  • 设置代理
1
2
3
4
git config --global http.proxy "http://127.0.0.1:xxxx"
git config --global https.proxy "http://127.0.0.1:xxxx"
# git config --global http.proxy "socks://127.0.0.1:xxxx"
# git config --global https.proxy "socks://127.0.0.1:xxxx"
  • 取消代理
1
2
git config --global --unset http.proxy
git config --global --unset https.proxy