2015-03-02 174 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操作。

这有一个明确的含义,但可能不是你想要的东西(虽然我不清楚你打算做什么)。