2014-04-29 27 views
0

因此,我創建了一個分支機構「slide-security-fix」將其推送到遠程,然後我切換到另一臺機器,克隆創建的分支並做了一些更改,但是這我的本地機器上的分支現在稱爲遠程/原點/幻燈片安全性修復。所以我試圖把這個分支回遠程與應用的變化:推送遙控器/起源/分支到遠程

git push origin remotes/origin/slide-security-fix 

,但它給我的錯誤:

error: src refspec remotes/origin/slide-security-fix matches more than one. 
error: failed to push some refs to 'myrepo.git' 

我一直在尋找解決方案,我發現的唯一的事情是指定我的遠程分支明確:

git push origin remotes/origin/slide-security-fix:remotes/origin/slide-security-fix 

但它仍然無法正常工作

回答

1

簡單所以lution會

git push origin HEAD:slide-security-fix 

它會告訴混帳推目前提交查出來,就稱爲遠程

你也可以給一個合適的名字給你工作的分支上slide-security-fix分支。你可以舉例

#Create a local branch on the current commit. Call it slide-security-fix. And check it out 
git checkout -b slide-security-fix 

#Then push 
git push origin slide-security-fix 
+0

非常感謝!答案很快就會被接受。 – inside