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.
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 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.
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 .
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.
git fetch git show remotes/origin/master:<filename>
Obviously your remote branch might not be at remotes/origin/master
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With