2017-09-20 66 views
0

我意外地簽出了一個分支從我目前簽出的分支,繼續工作,並致力於這個分支,讓我們稱這個分支feature/foo刪除(錯誤的)遠程分支推送(右)分支時,兩個分支具有相同的名稱

然後我意識到我在錯誤的分支,因爲只有一些變化,我很難復位到右分支,並再次添加更改並刪除了其他分支git branch -d foo。在gitk中一切看起來都很好。

現在我試圖推動,並得到:

error: failed to push some refs to 'https://some-repository.git' 
hint: Updates were rejected because the tip of your current branch is behind 
hint: its remote counterpart. Integrate the remote changes (e.g. 
hint: 'git pull ...') before pushing again. 
hint: See the 'Note about fast-forwards' in 'git push --help' for details. 

現在git fetch帶回刪除分支。現在我堅持與feature/foo,其中包含更改和remotes/origin/feature/foo,我想要刪除。

我該如何擺脫remotes/origin/feature/foo並能夠推動我的更改?

+0

什麼是git拉說。 –

+0

* [新分會]功能/ foo - > origin/feature/foo 當前分支沒有跟蹤信息。 請指定您想要合併的分支。 有關詳細信息,請參見git-pull(1)。 GIT中拉 如果要設置該分支跟蹤信息可以用做: GIT中分支--set-上游到原點=/特徵/富 – tobilocker

+0

GIT中推原點

回答

0

問題是兩個分支有相同的名稱。重命名當前簽出的分支會修復此問題。