Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git equivalent of `svn cat` with remote repository

Tags:

I am looking for the equivalent of svn cat in git.

Yes, I am aware that the similar question was asked here. The answer is to use git show rev:path.

However, svn cat can be used for the remote repository. That is, I can do svn cat url@rev and get the file from the specified revision of the remote repository, without getting the whole repository. My understanding is that git show only applies to the local repository.

A workaround I found is to use gitweb interface to get the blob.

like image 357
sanxiyn Avatar asked May 15 '10 05:05

sanxiyn


People also ask

What is cat in git?

The cat (short for “concatenate“) command is one of the most frequently used commands in Linux/Unix-like operating systems. cat command allows us to create single or multiple files, view content of a file, concatenate files and redirect output in terminal or files.

What is subversion in git?

What is Git-SVN? The git-svn tool is an interface between a local Git repository and a remote SVN repository. Git-svn lets developers write code and create commits locally with Git, then push them up to a central SVN repository with svn commit-style behavior.

Is SVN checkout same as git clone?

git clone is more of an analogue to svn checkout than git checkout . git checkout just checks out a branch or commit from your local repository. git clone makes a new copy of a remote repository. +1, Just to emphasize, in 99% of case you'd do an svn checkout you'd need a git clone .

Which is Better git or SVN?

SVN is better than Git for architecture performance, binary files, and usability. And it may be better for access control and auditability, based on your needs.


1 Answers

git fetch git show remotes/origin/master:<filename> 

Obviously your remote branch might not be at remotes/origin/master.

like image 183
Robin Winslow Avatar answered Sep 22 '22 04:09

Robin Winslow