Git 分支与 refs/heads/developer 分离



我运行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命令的新手。

看起来您从未git rebase --continue停止后继续变基。这是必需的。

最新更新