Re: Restoring files from old commits

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Tangentially related to my previous question:

Every once and a while I want to examine an older version
of a file in an editor.

(The typical case is first looking for the source of a change
with git-blame, and then wanting to look at the original code
and the diff side by side.)

My current (suboptimal, I hope!) way of doing getting the file
is git-cat-file: first look at the commit, then look at the tree,
... till I find the SHA1 for the file I want.

git-checkout <sha1-of-commit> <path>, but that leaves the old
version in both the index and the tree, which feels icky especially
if I'm giving this treatment to multiple files at the same time.

So what I'd like is something like

 git cat-path <commit> <path-in-the-tree-referenced-by-that-commit>

Does this exist, or is this scripting time?

Cheers,

 -- Nikodemus
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux