[cmake-developers] git equivalent to 'svn cat'

James Bigler jamesbigler at gmail.com
Tue Sep 14 14:33:05 EDT 2010


On Tue, Sep 14, 2010 at 12:23 PM, Brad King <brad.king at kitware.com> wrote:

> On 09/14/2010 01:22 PM, James Bigler wrote:
> > I'm trying to produce the equivalent command of 'svn cat' in git.
> > According to some documentation I'm supposed to be able to use git show:
> >
> > http://git.or.cz/course/svn.html
> >
> > You can see the contents of a file, the listing of a directory or a
> > commit with:
> >
> > git show /rev/:/path/to/file/           svn cat /url/
> > git show /rev/:/path/to/directory/   svn list /url/
> > git show /rev                           /svn log -r/rev/ /url/
> >                                             svn diff -c/rev/ /url/
> > //
> > I don't seem to be able to produce the correct rev:path/to/directory
> > necessary to make it work, however.
> >
> > $ git show HEAD:git://cmake.org/cmake.git/Modules
> > <http://cmake.org/cmake.git/Modules>
> > fatal: Not a git repository (or any of the parent directories): .git
>
> Git operations work locally.  Only special operations, "clone", "fetch",
> "push", and a couple others work with remote repositories.  You cannot
> use a URL with other commands.
>
>
Ah.  This is the point that I didn't know.  OK, so if I want a copy of a
single file or sub-directory, I have to clone the entire repository just to
get it?  Is there no possible way to get a single file or sub-directory?

James
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20100914/87525fef/attachment.html>


More information about the cmake-developers mailing list