git
title: git
date: 2022-01-16 15:04:50
tags:
git config --global user.email 'dean0731@qq.com'
git config --global user.name '华为主机'
git fetch --all && git reset --hard origin/master && git pull
git fetch --all && git reset --hard origin/dev && git pull
git rm -r --cached .
git add .
git commit -m 'update .gitignore'
# 查看所有远程仓库
git remote
# 查看指定远程仓库地址
git remote -v
# 添加远程仓库
git remote add origin https://github.com/Dean0731/Segmentation.git
# 更新远程仓库地址
git remote set-url origin 你新的远程仓库地址remote
git branch 当前分支
git branch -a 所有当前分支
# 删除分支(已提交的分支)
git branch -d xx
# -D 强制删除分支
# 本地分支提交到远程
git push --set-upstream origin 分支
git add . && git commit -m 'update' && git push
# 同步分支情况
git remote prune origin
# 设置当前代理
git config --global http.proxy http://127.0.0.1:20172
# 取消当前代理
git config --unset http.proxy
#取消全局代理
git config --global --unset http.proxy
#设置socks5代理
git config --global http.proxy socks5://127.0.0.1:20170
评论已关闭