On Fri, Jul 17, 2020 at 11:09:28AM -0500, lbd...@gmail.com wrote:

[...]
> > > The indicated command streams the contents of the named file as recorded
> > > in the named commit to a file. The stream gets saved no matter whether you
> > > consider the file to be textual or binary - as on contemporary commodity
> > > operating systems such distinction does not exist. I mean, whether a file
> > > contains textual or binary data is strictly a matter of interpretation.
> > 
> > So what the problem really is?
> > I think we could provide better advice if we'd know.
> 
> The show works great with text files but files that are in binary per,
> gitattributes and chtag, do not come out usable.  All the files have been
> transferred from the IBM z/OS mainframe using cp and they can be transferred
> back and all work - both text and binary.  But when trying to use 'git show'
> to look at a prior version of one of the binary files results in a file that
> is not usable and I'm not sure how more to explain that.  When I look at the
> current file in the directory it looks fine.

I see, so the smudge filter possibly kicks in and spoils the file, OK.

You can now go one level deeper - to the so-called "plumbing" layer of Git
commands to get what you're after ;-)

The low-level command to get the contents of any kind of oject in Git is
`git cat-file`; by default, it does not apply any applicable conversions, so
you should be just fine using it.

To get the contents of a file foo/bar.bin as recorded in commit XYZ,
you could call

  $ git cat-file blob XYZ:foo/bar.bin > path/to/save/the/contents.bin

The <revision>:<pathname> form is the standard way to refer to a file recorded
as <pathname> in a commit, to which <revision> resolves.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/20200717182830.fm2pb4dk5qb4x4d7%40carbon.

Reply via email to