git 的 cat-file 命令用法
2017-05-05 17:13
567 查看
命令选项
git cat-file Provide content or type and size information for repository objects.git cat-file命令显示版本库对象的内容、类型及大小信息。
object
The name of the object to show. For a more complete list of ways to spell object names, see the “SPECIFYING REVISIONS” section in gitrevisions(7).
-t
Instead of the content, show the object type identified by object.
显示对象的类型。
-s
Instead of the content, show the object size identified by object.
显示对象的大小。
-e
Suppress all output; instead exit with zero status if object exists and is a valid object.
如果对象存在且有效,命令结束状态返回值为 0 。
-p
Pretty-print the contents of object based on its type.
根据对象的类型,以优雅的方式显式对象内容。
type
Typically this matches the real type of object but asking for a type that can trivially be dereferenced from the given object is also permitted. An example is to ask for a “tree” with object being a commit object that contains it, or to ask for a “blob” with object being a tag object that points at it.
用法示例
sha1sum命令生成字符串 “Git” 的哈稀值:
printf Git | sha1sum
生成
HEAD对象的哈稀值:
(printf "%s %d\000" `git cat-file -t HEAD` `git cat-file -s HEAD`; git cat-file -p HEAD) | sha1sum
参考
git-cat-filegitrevisions
相关文章推荐
- Linux系统中,有两个文件file1和file2,每个文件的每一行都是#UUID,其中的每一UUID表示一个号。要找出在file1中有而在file2中没有的UUID,使用cat,sort,uniq三个命令如何实现
- Git 命令参数及用法详解 & Linux编程环境下版本控制 Git使用
- git命令之git clone用法
- Git 命令参数及用法详解
- Git 命令参数及用法详解
- cat 命令的用法
- linux中的一些基础命令的使用(which,whereis,locate,find,alias,file,ls,cat,echo,tar,bzip2,gzip,history,mv,cp,rm)
- git命令之git fetch 用法 2
- git命令之git fetch的用法
- linux 下cat命令的用法
- git 的基本命令用法
- Linux cat命令用法
- Git 命令参数及用法详解
- linux git命令参数及用法详解--版本控制工具
- git命令之git rebase 的用法
- Linux中cat命令的用法
- Git 命令参数及用法详解
- 删除文件夹命令、cat的用法
- git-cat-file(1) Manual Page
- linux git命令参数及用法详解--版本控制工具