2015-03-02 98 views
0

我有一個遠程分支:比方說我X ,我有一個鏡像或以上:讓我們說Y 在Y中,我有另一個分支功能。從rebase,rebase,分支信息丟失後,從遠程分支git rebasease

我想變基特徵與X,所以嘗試以下命令: git的重訂X /主Y /功能

在此之後,分支信息丟失,我不能夠推任何更改。

任何指針?

+1

您不能重新綁定遠程跟蹤分支... – Jubobs 2015-03-02 08:53:46

+0

如果torek的答案完全解答了您的問題,請考慮接受它。 – Jubobs 2015-03-03 13:37:41

回答

3

由於Jubobs指出in a comment,你不能那樣做。

更具體地,文檔的註釋:

git rebase ... [upstream [branch]]

如果指定branchgit rebase將執行自動git checkout branch之前做別的事情。 ...

在您的例子,你寫道:

git rebase X/master Y/feature

這裏,upstreamX/master,並且branchY/feature,所以rebase過程做啓動git checkout Y/feature

如果你自己試用,你會看到:

Note: checking out 'Y/feature'. 

You are in 'detached HEAD' state. You can look around, make experimental 
changes and commit them, and you can discard any commits you make in this 
state without impacting any branches by performing another checkout. 

所以,git rebase將通過把你變成 「分離的頭」 狀態開始。然後,它將使用X/master作爲新拆分HEAD的上游進行通常的rebase操作。

這有一個明確的含義,但可能不是你想要的東西(雖然我不清楚你打算做什麼)。