I sometimes need to do this too. I start with the command:

git log -- some.file.txt

In my case, this is the file: bvir.txt (a strange stat file from another
system)

I enter: "git log -- bvir" (no quotes, of course), and get a list like:

commit b6cf0ddb83381ed3d0e2001d3d28935106bcbc8c
Author: John Archie McKown <john.archie.mck...@gmail.com>
Date:   Wed Oct 7 08:16:42 2015 -0500

    10/07/2015 08:25:49 VERSION 01

commit e106f581ff950a9eddf46e0126414e0407fcd5c3
Author: John Archie McKown <john.archie.mck...@gmail.com>
Date:   Tue Oct 6 08:22:35 2015 -0500

    10/06/2015 08:31:47 VERSION 01

commit 98767d3ad5acbb5750f5f9283df787a2ab62f9ab
Author: John Archie McKown <john.archie.mck...@gmail.com>
Date:   Mon Oct 5 08:15:58 2015 -0500

    10/05/2015 08:25:14 VERSION 01

commit 3264eb3e79d9949dc56dd3cc5133f8d6198f198a
Author: John Archie McKown <john.archie.mck...@gmail.com>
Date:   Sun Oct 4 08:14:26 2015 -0500

    10/04/2015 08:24:03 VERSION 01

commit 1ba481ed914aeb5c3d67f89438b4a91571de997d
Author: John Archie McKown <john.archie.mck...@gmail.com>
Date:   Sat Oct 3 08:14:21 2015 -0500

    10/03/2015 08:24:03 VERSION 01

commit 70243d937b03c1be93b786885ca9e7e4f0eb8691
Author: John Archie McKown <john.archie.mck...@gmail.com>
Date:   Fri Oct 2 08:19:50 2015 -0500

    10/02/2015 08:28:10 VERSION 01


I can look at that for the one that I want, say the second from the bottom
as an example, and do

git show 1ba481ed914aeb5c3d67f89438b4a91571de997d:bvir.txt >some.other.name

If I want to see the differences between that particular one, and the one
in my working directory:

git diff 1ba481ed914aeb5c3d67f89438b4a91571de997d  -- bvir.txt

This compares only bvir.txt (since it is specified after the --) from the
commit and the one in the working directory. If you run on Linux, I have a
really "interesting"(?) script that I use to load _all_ of the versions of
bvir.txt into separate files in my working directory. I can post it here.
There is a BASH shell script, which is 13 lines, and an awk program, which
is 11 lines. They may cause "real programmers" to shudder. But they work
for me.

On Sun, Oct 11, 2015 at 1:50 PM, Kenoli Oleari <kenol...@gmail.com> wrote:

> I've installed GIT, can do all the actions to commit a file but, somehow,
> cannot figure out how to actually see a previous version of my file.
>
> I've tried some commands related to history that return things to me that
> I can't make any sense out of.
>
> I've bought several books on this, all of which go into great detail about
> branches and collisions and remotes and more, but nothing about actually
> looking at a previous version of a file.
>
> I even went to a workshop at a conference and couldn't understand enough
> to ask question about seeing a previous file version in a way that the
> speaker understood what I was talking about.
>
> Can someone help me with this?  I'm obviously out in the ozone.
>
> I'm anxious to make use of this tool everyone is raving about.
>
> Perplexed...
>
> --Kenoli
>
> --
> You received this message because you are subscribed to the Google Groups
> "Git for human beings" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to git-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Schrodinger's backup: The condition of any backup is unknown until a
restore is attempted.

Yoda of Borg, we are. Futile, resistance is, yes. Assimilated, you will be.

He's about as useful as a wax frying pan.

10 to the 12th power microphones = 1 Megaphone

Maranatha! <><
John McKown

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to