1. 程式人生 > >Git 本地新建,刪除分支並推送到遠程倉庫

Git 本地新建,刪除分支並推送到遠程倉庫

out java branch match upstream ast github上 onf fault

在本地新建一個分支: git branch newBranch
切換到你的新分支: git checkout newBranch
創建並切換到新分支: git checkout -b newBranch
將新分支發布在github上: git push origin newBranch
在本地刪除一個分支: git branch -d newBranch
在github遠程端刪除一個分支: git push origin :newBranch   (分支名前的冒號代表刪除)

直接使用git pull和git push的設置
git branch --set-upstream-to=origin/master master 
git branch --set-upstream-to=origin/ThirdParty ThirdParty
git config --global push.default matching

  

Git 本地新建,刪除分支並推送到遠程倉庫