2017-08-03 86 views
0

我叉的存儲庫,設置遠程配置:GIT:從叉庫創建分支

git remote -v 
origin https://github.com/myAccount/someRepo.git (fetch) 
origin https://github.com/myAccount/someRepo.git (push) 
upstream https://github.com/someAccount/someRepo.git (fetch) 
upstream https://github.com/someAccount/someRepo.git (push) 

但我想創建分支:

https://github.com/myAccount/someRepo.git 

如果我在本地,然後創建一個分支推分支,那個分支只會去origin

例如:

git checkout -b debug 

git push -u origin debug 
+0

@ das-g我想知道的是創建一個分支,它只會在原點上創建? – user2924482

+0

我已經改寫你的問題(有希望)更清楚。它仍然問你想問什麼? –

+0

是的。你必須指定發送上游,如果這是你想'git push --set-upstream origin debug'。 – Darlesson

回答

0

如果你運行:

git push -u <remote> <branch> 

這將(一)推動分支<branch>遠程<remote>,和(b)之後,在該分支運行git push而將始終推送到<remote>。我相信這會回答你的問題。