0

I run the git checkout <commid-id> and once the HEAD was in detached state, I made few commits to in the detached state. Then I created the branch called developer so that all the commits that I did when in detached state came inside my developer branch. Now I ran the command git checkout developer and then git rebase master. I got few conflicting changes and then I closed the terminal.

The next time I opened and ran the git rebase master I got the below message

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.

I ran the below command rm -fr "/Users/pl1/my-project/.git/rebase-apply"

Now when I run the git branch command I get the below:

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

I ran the git rebase master command once again. Got the below message:

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

Running git status command now gives:

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

I am confused with my current state. How to rebase my developer branch changes to master from here. Is my changes inside the developer branch lost now? Please let me know since I am new to running the git rebase command.

zilcuanu
  • 3,451
  • 8
  • 52
  • 105
  • Why are you working in the detached head state in the first place? This is typically done for exploratory reasons. If you want a branch from `master`, then just create and do your work there. And also, why are you rebasing on `master`? On which were you when you entered the detached state? – Tim Biegeleisen Mar 15 '16 at 05:01

1 Answers1

1

It looks like you never did git rebase --continue to continue the rebase after the stop. This is required.

Martin G
  • 17,357
  • 9
  • 82
  • 98