All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Shawn O. Pearce" <spearce@spearce.org>
To: "Sam G." <ceptorial@comcast.net>
Cc: git@vger.kernel.org
Subject: Re: Searching all git objects
Date: Wed, 25 Jun 2008 19:17:42 -0400	[thread overview]
Message-ID: <20080625231742.GT11793@spearce.org> (raw)
In-Reply-To: <E99352BE-5C43-437E-A5E6-622BEEA03DFA@comcast.net>

"Sam G." <ceptorial@comcast.net> wrote:
> We recently had a developer make a large commit (mostly centered  
> around one file) which she believed she properly pushed to a remote  
> repository last week, but looking at both her repository and the  
> remote repository, that commit is now nowhere to be found. If somehow  
> the master branch she was working on in her repository has lost the  
> reference to the commit through perhaps some errant rebasing, then  
> perhaps an object containing the commit (or an object containing the  
> file in that commit) still exists somewhere inside her .git/objects  
> directory? We haven't done any git-gc recently. If so, how can I  
> search through every single git object in her objects directory,  
> searching for perhaps a specific part of the commit string, a line in  
> the code or the filename of the file which was changed? Any help with  
> this would be greatly appreciated. Thanks!

Odds are it is in her HEAD reflog.  You can look for it with
`git log -g`.  If you know some part of the commit message you
may be able to filter it down with `git log -g --grep=X` or part
of the change with `git log -g -SX`.

A coworker just did something like that today and lost his change;
looking in the HEAD reflog and cherry-picking the commit recovered
it quite easily.

-- 
Shawn.

  reply	other threads:[~2008-06-25 23:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-25 23:06 Searching all git objects Sam G.
2008-06-25 23:17 ` Shawn O. Pearce [this message]
2008-06-25 23:32   ` Tarmigan
2008-06-26  0:49     ` Sam G.
2008-06-26  1:00       ` Junio C Hamano
2008-06-26 22:23         ` Sam G.

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=20080625231742.GT11793@spearce.org \
    --to=spearce@spearce.org \
    --cc=ceptorial@comcast.net \
    --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 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.