2016-03-15 155 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。這是必需的。