Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git-hash-object: add page #9060

Merged
merged 11 commits into from
Oct 19, 2022
20 changes: 20 additions & 0 deletions pages/common/git-hash-object.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# git hash-object

> Computes the unique hash key of content and optionally creates an object with specified type.
> More information: <https://git-scm.com/docs/git-hash-object>.

- Compute the ID that would be used to store it in git database:
nath1as marked this conversation as resolved.
Show resolved Hide resolved

`git hash-object {{/path/to/file}}`
nath1as marked this conversation as resolved.
Show resolved Hide resolved

- Compute the ID and store it in git database:
nath1as marked this conversation as resolved.
Show resolved Hide resolved

`git hash-object -w {{/path/to/file}}`
nath1as marked this conversation as resolved.
Show resolved Hide resolved

- Compute the ID and specify the type of object:
nath1as marked this conversation as resolved.
Show resolved Hide resolved

`git hash-object -t {blob | tree | commit | tag} {{/path/to/file}}`
nath1as marked this conversation as resolved.
Show resolved Hide resolved

- Compute the ID from user input instead of a file:
nath1as marked this conversation as resolved.
Show resolved Hide resolved

`git hash-object --stdin`
nath1as marked this conversation as resolved.
Show resolved Hide resolved