GIT Y U NO...

| Comments (1) | Software
You have to have used git to really understand this one, but...
[16] git checkout f4a56
Note: checking out 'f4a56'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b new_branch_name

HEAD is now at f4a560b... Foo
As you may have gathered from this long warning, you most likely don't want to be in a detached head setting, you probably just meant to create a branch or wanted to rollback a commit but typed the wrong thing. Which is why there are lots of pages about what this means and how to get yourself out. My contribution to this literature can be found below the fold.

1 Comments

Why is it that I feel like I spend most of my life in a detached head state?

If you spend too much time looking at the union of cheap shots on the language we use as programmers and lowbrow philosophical musings, it explains a lot.

Leave a comment