All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael J Gruber <git@drmicha.warpmail.net>
To: Daniel Grace <negativeview@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Lost a week?
Date: Thu, 15 Apr 2010 16:11:56 +0200	[thread overview]
Message-ID: <4BC71EAC.8050602@drmicha.warpmail.net> (raw)
In-Reply-To: <t2s62a3a9cb1004150657g5baabb42o512e0e103d1e9596@mail.gmail.com>

Daniel Grace venit, vidit, dixit 15.04.2010 15:57:
> Appologies for not having more information. I usually use git as if
> it's just SVN with non-network checkins.
> 
> A few days ago, I pushed my git repository to github:
> 
> 127  git remote add github
> git@github.com:negativeview/Wherespresso.git [Note, this is a private
> repo]
> 128  git push github master
> 
> I then went about doing real-world business. I noticed at some point
> that when I did a `git status` it said that no branches were checked
> out. I don't remember doing anything between pushing to github and
> this state. If I did a git branch it shows something like * (no
> branch) then below that, master. I shrugged it off and did what I
> expected to fix that odd issue:
> 
> 515  git branch
> 516  git checkout master
> 
> Now, the next day, I noticed that I have no git history between the
> 6th and something I did soon after the git checkout master:
> 
> $ git log | grep Date | head -n 5
> Date:   Wed Apr 14 14:43:58 2010 -0500
> Date:   Tue Apr 6 00:42:20 2010 -0500
> Date:   Mon Apr 5 23:57:54 2010 -0500
> Date:   Mon Apr 5 07:01:26 2010 -0500
> Date:   Mon Apr 5 06:17:18 2010 -0500
> 
> 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.
> 
> Daniel
> http://www.doomstick.com

Backup now.

Most probably, you've made those commits on a detached HEAD. May you
have checked out a remote branch, or a specific commit, before you went
about your business on or after 6th?

git reflog (or git log -g) will be able to show you the history of your
HEAD before you lost it ;)

Then you can tag those commits or 'checkout -b safehaven
nameofthetopcommit' to get a branch with those commits. Now they are
safe from being pruned during garbage collection.

Michael

  reply	other threads:[~2010-04-15 14:15 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 [this message]
2010-04-15 14:16 ` Thomas Rast
2010-04-15 14:16 ` Matthieu Moy
2010-04-15 14:29   ` Daniel Grace

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=4BC71EAC.8050602@drmicha.warpmail.net \
    --to=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    --cc=negativeview@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.