git branch与refs / heads / developer

时间:2016-03-15 04:58:03

标签: git git-branch git-rebase

我运行git checkout <commid-id>,一旦HEAD处于分离状态,我几乎没有提交到处于分离状态。然后我创建了一个名为developer的分支,这样我处于分离状态时所做的所有提交都进入了我的developer分支。现在我运行了命令git checkout developer,然后git rebase master。我收到了一些相互矛盾的变化,然后我关闭了终端。

下次我打开并运行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:   root@remotehost.corp.net

我对目前的状态感到困惑。如何将我的开发人员分支变更为master来自此处。我的developer分支内的更改现在丢失了吗?请告诉我,因为我刚开始运行git rebase命令。

1 个答案:

答案 0 :(得分:0)

看起来你从来没有git rebase --continue在停止后继续使用rebase。这是必需的。