Ask Your Question
0

Please teach the method of fixing 'detached HEAD' state [closed]

asked 2014-08-01 03:32:26 -0500

14saki gravatar image

updated 2014-08-05 00:40:13 -0500

I want to abandon everything. And, I want to start again.

I deleted some commit registered in review. Having done the operation that did not have to be done noticed later. Committing that had been executed afterwards seems to have entered 'Detached HEAD' state. It is output to the log of pylint with "You are in 'detached HEAD' state.".

The local branch is not in the state of Detached-HEAD. I want to cancel the state of Detached-HEAD of the remote branch.

It is a state of detached HEAD when downloading it from review.openstack.org . $ git fetch https://user@review.openstack.org/ope... refs/changes/81/111881/1 && git checkout FETCH_HEAD

How should I do to return it normally?


2014-08-01 07:44:31.931 | + git fetch http://zm02.openstack.org/p/openstack/cinder refs/zuul/master/Ze495082d67c14b6eb71b8adf7828db16
2014-08-01 07:44:33.890 | From http://zm02.openstack.org/p/openstack/cinder
2014-08-01 07:44:33.927 |  * branch            refs/zuul/master/Ze495082d67c14b6eb71b8adf7828db16 -> FETCH_HEAD
2014-08-01 07:44:33.927 | + git checkout FETCH_HEAD
2014-08-01 07:44:33.928 | Note: checking out 'FETCH_HEAD'.
2014-08-01 07:44:33.928 | 
2014-08-01 07:44:33.928 | You are in 'detached HEAD' state. You can look around, make experimental
2014-08-01 07:44:33.928 | changes and commit them, and you can discard any commits you make in this
2014-08-01 07:44:33.928 | state without impacting any branches by performing another checkout.
2014-08-01 07:44:33.928 | 
2014-08-01 07:44:33.928 | If you want to create a new branch to retain commits you create, you may
2014-08-01 07:44:33.928 | do so (now or later) by using -b with the checkout command again. Example:
2014-08-01 07:44:33.928 | 
2014-08-01 07:44:33.929 |   git checkout -b new_branch_name
2014-08-01 07:44:33.929 | 
2014-08-01 07:44:33.929 | HEAD is now at 04851ba... Add Fujitsu ETERNUS DX support
edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by 14saki
close date 2014-08-05 03:47:50.739066

1 answer

Sort by ยป oldest newest most voted
1

answered 2014-08-05 00:42:58 -0500

The answer is in the output itself. git checkout -b <some_branch_name>

Steps are
   1)  git fetch http://zm02.openstack.org/p/openstack/cinder refs/zuul/master/Ze495082d67c14b6eb71b8adf7828db16
   2) git checkout -b MyChanges
   3) git branch  //  Now you will be in the branch Mychanges which has all your change.
edit flag offensive delete link more

Comments

Thank you for your reply. The matter in the state of Detached HEAD was solved. Thank you.

14saki gravatar image14saki ( 2014-08-05 03:45:55 -0500 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2014-08-01 03:32:26 -0500

Seen: 702 times

Last updated: Aug 05 '14