2013-03-29 46 views
-3

任何時候,我打開一個分支(我需要每票之一),我嘗試只是git push我得到上一個新的分支混帳推:自動

fatal: The current branch testchx has no upstream branch. 
To push the current branch and set the remote as upstream, use 

    git push --set-upstream origin testchx 

做的是有沒有辦法讓Git自動做git push --set-upstream origin testchx而不是致命的死亡?

Git版本:1.8.1.4

+1

你想實現什麼?你想在你的中央倉庫上創建一個'testchx'分支嗎?或者你想將'testchx'合併爲'origin/master'? –

+0

'git config push.default current' *正是*我想要的。 – chx

回答

2

一種方式是按照錯誤消息的指示:

git push --set-upstream origin testchx 

另一個是設置push.default行爲:

git config push.default current 

更多細節:

git help config