我今天遇到了git push的問題。我試圖將一個分支推送到遠程存儲庫,但它給出了一個錯誤。爲什麼git push有時需要一個localref參數?
一些搜索後,我問它的git的IRC頻道,有人說,推的語法是
git push <remote> <localref>:<remoteref>
到現在爲止,我只是用它工作得很好混帳推。但在這種情況下,它失敗了。
我試着把比主遠程服務器上的其他一些分支,我得到了以下錯誤:
error: src refspec xi-temp-dennis does not match any.
error: failed to push some refs to 'remote.server'
通過指定localRef所,它突然worken。
我的問題是,爲什麼我這次需要指定localref?
是啊,我剛剛纔明白。當我做git push remote xi-temp-dennis時,它會在我的本地存儲庫中尋找名爲xi-temp-dennis的分支,而我認爲它會指定遠程存儲庫上的分支。 – Ikke 2009-06-03 20:19:31