- 设定网络代理服务器
git config http.proxy http://proxy-server:port // 设定当前代码库的网络代理
git config https.proxy http://proxy-server:port // 设定当前代码库的网络代理
git config --global http.proxy http://proxy-server:port // 设定全局的网络代理
git config --global https.proxy http://proxy-server:port // 设定全局的网络代理
git config --unset http.proxy // 取消网络代理设置
git config --unset https.proxy http://proxy-server:port // 取消网络代理设置
git config --unset --global http.proxy // 取消全局的网络代理
git config --unset --global https.proxy // 取消全局的网络代理
- 初始化
git init // 将当前目录初始化为git目录
git clone http://remote-repository local-folder //将远程代码库复制到本地
- 下载/上传代码
git pull // 使用远程代码库更新本地代码
git push // 将本地代码上传到远程代码库
git push --tags // 上传本地标签到远程代码库
- 分支操作
git checkout //切换分支
git checkout -b new-branch // 创建新的分支
- 查看提交历史
git log