[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gits] Finding info in git history
- Subject: [gits] Finding info in git history
- From: ricci at cs.utah.edu (Robert Ricci)
- Date: Thu, 13 Feb 2014 12:42:09 -0700
- In-reply-to: <m1ppmqn9ui.fsf@cs.utah.edu>
- References: <CAJz08q-YD0AFimmT1XcmzKXxcjNMVCHx5ahQohpG=e5mQj28tQ@mail.gmail.com> <m1ppmqn9ui.fsf@cs.utah.edu>
My favorite version is the ?git pickaxe?:
http://stackoverflow.com/questions/1337320/how-to-grep-git-commits-for-a-certain-word
Basically, you just add ?-Sfoo? to your ?git log? command line, and you a list of only changes that involved the string ?foo? (which can actually be a full regular expression if you want, though I rarely use it that way.)
(This is the second answer on the stackoverflow thread that Eric pointed to, but I find it to be a lot easier to use than the first answer on the thread.)
On Feb 13, 2014, at 11:31 AM, Eric Eide <eeide at cs.utah.edu> wrote:
> Dan> I appear to have removed string/code sometime in the history of my
> Dan> project. I would like to find the file(s) that had this
> Dan> string/code and the commit where it was removed.
>
> Perhaps the recipe described here:
>
> http://stackoverflow.com/questions/2928584/how-to-grep-search-committed-code-in-the-git-history
>
> --
> -------------------------------------------------------------------------------
> Eric Eide <eeide at cs.utah.edu> . University of Utah School of Computing
> http://www.cs.utah.edu/~eeide/ . +1 (801) 585-5512 voice, +1 (801) 581-5843 FAX