2016-03-15 153 views
0

我运行了git checkout <commid-id>,一旦HEAD处于分离状态,我在分离状态下做了很少的提交。然后我创建了一个名为developer的分支,以便我在分离状态下进行的所有提交进入我的developer分支。现在我运行命令git checkout developer,然后运行git rebase master。我几乎没有冲突的变化,然后我关闭了终端。git分支与refs/heads/developer分离

下一次我打开并运行git rebase master我得到的消息如下

It seems that there is already a rebase-apply directory, and 
I wonder if you are in the middle of another rebase. If that is the 
case, please try 
git rebase (--continue | --abort | --skip) 
If that is not the case, please 
rm -fr "/Users/pl1/my_project/.git/rebase-apply" 
and run me again. I am stopping in case you still have something 
valuable there. 

我跑到下面的命令 RM -fr“/Users/pl1/my-project/.git/rebase-apply “

现在,当我运行git branch命令我得到的下面:

*(detached from refs/heads/developer) 
    developer 
    master 

我跑了git rebase master命令Ø再次。得到了以下信息:

Cannot rebase: You have unstaged changes. 
Additionally, your index contains uncommitted changes. 
Please commit or stash them. 

运行git status命令现在给:

HEAD detached from refs/heads/developer 
Changes to be committed: 
(use "git reset HEAD <file>..." to unstage) 

modified: client/app/filterEnv/filterEnv.directive.js 
modified: client/app/filterEnv/filterEnv.html 
modified: client/app/filterEnv/filterEnv.scss 
modified: client/app/hostsTable/hostsTable.directive.js 
modified: client/app/main/main.html 
modified: client/app/results/results.html 
modified: package.json 

Unmerged paths: 
(use "git reset HEAD <file>..." to unstage) 
(use "git add <file>..." to mark resolution) 

both modified: [email protected] 

我很困惑我目前的状态。如何将我的开发人员分支更改为来自这里的主人。 developer分支中的我的更改现在丢失了吗?请让我知道,因为我是运行git rebase命令的新手。

+0

为什么你首先在分离的头部状态工作?这通常是由于探索性原因而完成的。如果你想从'master'分支,那么只需在那里创建并完成你的工作。还有,你为什么要重定主人?当你进入分离状态时,你是哪个人? –

回答

0

它看起来像你从来没有做过git rebase --continue在停止后继续rebase。这是必需的。