Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions pages/common/git-cat-file.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# git cat-file

> Provide content or type and size information for git repository objects.
> More information: <https://git-scm.com/docs/git-cat-file>.

- Get the [s]ize of the HEAD commit in bytes:

`git cat-file -s HEAD`

- Get the [t]ype (blob, tree, commit, tag) of a given git object:

`git cat-file -t {{8c442dc3}}`

- Pretty-[p]rint the contents of a given git object based on its type:

`git cat-file -p {{HEAD~2}}`