2017-03-02 117 views
0

我已經從遠程存儲庫創建了一個分支並更改了本地回購的名稱。稍後,我通過運行git branch --unset-upstream命令刪除了跟蹤。 現在,當我試圖把我的本地更改到遠程分支我提示以下錯誤:git推送到遠程分支拋出錯誤

git push --set-upstream origin feature/my_remote_branch 

error: src refspec feature/my_remote_branch does not match any. 
error: failed to push some refs to 'https://[email protected]/scm/app/app.git' 

我要去哪裏錯了?

+0

Ofcourse你,如果你正在使用--unset上游收到此錯誤。仔細閱讀文檔。 – ckruczek

+0

我更新了我的問題中的git push命令。仍然得到相同的錯誤 – zilcuanu

+0

什麼是本地分支的名稱,遠程分支的名稱是什麼? – Vampire

回答

-1

如果你正在推動首次嘗試

git push origin -u feature/my_remote_branch 
0

試試這個:git push -u <remote> <local-branch>:<remote-branch>

$ git push -u origin feature-one-branch:my_remote_branch 


Or, (if not works) 
$ git push -u feature my_remote_branch 
0

由於本地和遠程分支機構有不同的名稱,你需要在推命令,同時指定只要你沒有相應的跟蹤設置。

git push --set-upstream origin feature/my_remote_branch試圖將本地分支feature/my_remote_branch推送到您本地沒有的遠程。

你應該叫

git push --set-upstream origin feature-one-branch:feature/my_remote_branch