On Jun 1, 4:39 pm, Dan Preston <danpres...@gmail.com> wrote:
> You should be ok.  You can use the "git reflog" command to view the
> history of what you've had checked out.  You can then checkout the
> hash commit of your latest work again and create a branch from it.  Or
> alternatively you can merge that hash back to master.

Thank the maker! So the commits are still in there. My reflog reads:

9c51d95... h...@{0}: checkout: moving from master to master
9c51d95... h...@{1}: checkout: moving from html-based to master
8f1c474... h...@{2}: checkout: moving from master to html-based
9c51d95... h...@{3}: checkout: moving from
8658a3910e3ca3b5e66fce6503b42fa431369430 to master
8658a39... h...@{4}: commit: added multi-pattern matches and evaluator
no longer uses traverse
bb34a07... h...@{5}: commit: admin: add REQUIRE file
425d22f... h...@{6}: commit: test: add helpers qed test
958447f... h...@{7}: commit: admin: add roadmap and fix version file

so I can do:

  $ git branch recentwork 9c51d95

And I will have a branch at that point?

> The (no branch) thing happens when you checkout a hash somewhere in
> your history that isn't associated with any tag or HEAD of a branch.
> If you then begin committing from there, you end up in the situation
> you are in now.  It's easy to rectify, but sometimes hard to notice.

I see. Well, it would be nice if it gave a little warning. I think I
understand why it happened now though. I was tagging some old versions
that I had failed to do in the past. Not exactly sure how but that
must have been why.

> I insert this into my bash .profile so that the current branch is
> displayed in my terminal prompt.  You may find it useful.
> # Show the git branch in the prompt
> PS1='[...@\h \W$(__git_ps1 " (%s)")]\$ '

I like it. I will use. Thanks.

You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-us...@googlegroups.com.
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to