等同于“hg cat”的git。或“svn cat” [英] Equivalent in git of "hg cat" or "svn cat"

查看:108
本文介绍了等同于“hg cat”的git。或“svn cat”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想提取保存在git存储库中的最新版本文件的副本,并将其传递到脚本中进行一些处理。使用svn或hg,我只需使用cat命令:


按给定修订版本打印指定文件。如果
没有给出修订版本,则使用工作目录的父目录
或者如果没有检出修订版本则提示。


(这是从hg文档中对hg cat的描述)



使用git做同样的命令是什么?

解决方案

  git show rev:path / to / file 

其中 rev 是修订版本。 http://git.or.cz/course/svn.html ,以便比较git和svn命令。


I want to extract a copy of the latest version of a file held in a git repository, and pass it into a script for some processing. With svn or hg, I just use the "cat" command:

Print the specified files as they were at the given revision. If no revision is given, the parent of the working directory is used, or tip if no revision is checked out.

(that's from the description of hg cat in the hg documentation)

What's the equivalent command to do this with git?

解决方案

git show rev:path/to/file

Where rev is the revision.

See http://git.or.cz/course/svn.html for a comparison of git and svn commands.

这篇关于等同于“hg cat”的git。或“svn cat”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆