# git-hash-object
> 原文: [https://git-scm.com/docs/git-hash-object](https://git-scm.com/docs/git-hash-object)
## 名稱
git-hash-object - 計算對象ID,并可選擇從文件創建blob
## 概要
```
git hash-object [-t <type>] [-w] [--path=<file>|--no-filters] [--stdin [--literally]] [--] <file>…?
git hash-object [-t <type>] [-w] --stdin-paths [--no-filters]
```
## 描述
使用指定文件的內容(可以在工作樹之外)計算具有指定類型的對象的對象ID值,并可選擇將結果對象寫入對象數據庫。將其對象ID報告給其標準輸出。 _git cvsimport_ 使用它來更新索引而不修改工作樹中的文件。當< type>未指定,默認為“blob”。
## OPTIONS
```
-t <type>
```
指定類型(默認值:“blob”)。
```
-w
```
實際上將對象寫入對象數據庫。
```
--stdin
```
從標準輸入而不是從文件中讀取對象。
```
--stdin-paths
```
從標準輸入讀取文件名,每行一個,而不是從命令行讀取。
```
--path
```
哈希對象,因為它位于給定的路徑。文件的位置不會直接影響哈希值,但路徑用于確定在將對象放置到對象數據庫之前應該將哪些Git過濾器應用于對象,并且,作為應用過濾器的結果,實際的blob放置進入對象數據庫可能與給定文件不同。此選項主要用于散列位于工作目錄外部的臨時文件或從stdin讀取的文件。
```
--no-filters
```
按原樣哈希內容,忽略屬性機制選擇的任何輸入過濾器,包括行尾轉換。如果從標準輸入讀取文件,則始終隱含,除非給出`--path`選項。
```
--literally
```
允許`--stdin`將任何垃圾散列到松散的對象中,否則可能無法通過標準對象解析或git-fsck檢查。用于壓力測試Git本身或復制野外遇到的腐敗或偽造物體的特征。
## GIT
部分 [git [1]](https://git-scm.com/docs/git) 套件
- git
- git-config
- git-help
- git-init
- git-clone
- git-add
- git-status
- git-diff
- git-commit
- git-reset
- git-rm
- git-mv
- git-branch
- git-checkout
- git-merge
- git-mergetool
- git-log
- git-stash
- git-tag
- git-worktree
- git-fetch
- git-pull
- git-push
- git-remote
- git-submodule
- git-show
- git-log
- git-shortlog
- git-describe
- git-apply
- git-cherry-pick
- git-rebase
- git-revert
- git-bisect
- git-blame
- git-grep
- gitattributes
- giteveryday
- gitglossary
- githooks
- gitignore
- gitmodules
- gitrevisions
- gittutorial
- gitworkflows
- git-am
- git-format-patch
- git-send-email
- git-request-pull
- git-svn
- git-fast-import
- git-clean
- git-gc
- git-fsck
- git-reflog
- git-filter-branch
- git-instaweb
- git-archive
- git-bundle
- git-daemon
- git-update-server-info
- git-cat-file
- git-check-ignore
- git-checkout-index
- git-commit-tree
- git-count-objects
- git-diff-index
- git-for-each-ref
- git-hash-object
- git-ls-files
- git-merge-base
- git-read-tree
- git-rev-list
- git-rev-parse
- git-show-ref
- git-symbolic-ref
- git-update-index
- git-update-ref
- git-verify-pack
- git-write-tree