From: Daniel Grace <negativeview@gmail.com>
To: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
Cc: git@vger.kernel.org
Subject: Re: Lost a week?
Date: Thu, 15 Apr 2010 09:29:26 -0500 [thread overview]
Message-ID: <v2r62a3a9cb1004150729v1e0a60bq381bc382f76f3c27@mail.gmail.com> (raw)
In-Reply-To: <vpqtyrc6bse.fsf@bauges.imag.fr>
Thanks everyone! I had heard the phrase "detached head" before, but
didn't really understand what it is. I'm glad to note that all my
commits were there. I wasn't really worried, I knew that git had
stored it dutifully away SOMEWHERE.
I have that page bookmarked now Thomas. Unfortunately I have customer
work to do now that I am not missing work, but I promise to read and
understand it fully as soon as I'm done with that.
Daniel
http://www.doomstick.com
On Thu, Apr 15, 2010 at 9:16 AM, Matthieu Moy
<Matthieu.Moy@grenoble-inp.fr> wrote:
> Daniel Grace <negativeview@gmail.com> writes:
>
>> github shows the same. I KNOW that there were commits (representing a
>> good bit of work) in that time. I'm sure that it's *somewhere* but I'm
>> at a complete loss as to where it is. gitk shows no side branches (nor
>> does git branch). I don't use branches really, as much as I know that
>> I should.
>
> I guess you've been on a detached HEAD for some time. Recent version
> of Git warn you this way when you enter in this state:
>
> ,----
> | Note: checking out 'HEAD^'.
> |
> | 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 a8e7ba9... foo
> `----
>
> Now, your changes are probably not lost forever: they're not reachable
> from a branch, but still there (but don't play with "git gc" until
> you're sure you've recovered all of it...). "git reflog" should give
> you the sha1 of the commit you're looking for (if you didn't really
> mess up everything, you really look for just one commit, which is the
> tip of the sequence of commits you did while on a detached HEAD, that
> is, the one just before you did "git checkout master".
>
> Then, do
>
> git branch tmp <the-sha1-you-found>
> (possibly run "gitk --all" to understand, here)
> git merge tmp
>
> to create a branch named tmp containing your commits, and merge it
> into your current branch. Naming the branch isn't strictly necessary,
> but will help in case you do anything wrong trying to merge.
>
> --
> Matthieu Moy
> http://www-verimag.imag.fr/~moy/
>
prev parent reply other threads:[~2010-04-15 14:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-15 13:57 Lost a week? Daniel Grace
2010-04-15 14:11 ` Michael J Gruber
2010-04-15 14:16 ` Thomas Rast
2010-04-15 14:16 ` Matthieu Moy
2010-04-15 14:29 ` Daniel Grace [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=v2r62a3a9cb1004150729v1e0a60bq381bc382f76f3c27@mail.gmail.com \
--to=negativeview@gmail.com \
--cc=Matthieu.Moy@grenoble-inp.fr \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).