亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

目錄 搜尋
Guides gitattributes giteveryday gitglossary gitignore gitmodules gitrevisions gittutorial gitworkflows Administration git archive git bundle git clean git filter-branch git fsck git gc git instaweb git reflog Basic Snapshotting git add git commit git diff git mv git reset git rm git status Branching and Merging git branch git checkout git log git merge git mergetool git stash git tag Debugging git bisect git blame git grep Email git am git format-patch git request-pull git send-email External Systems git fast-import git svn Getting and Creating Projects git clone git init Git git annotate git archimport git bisect-lk2009 git check-attr git check-mailmap git check-ref-format git checkout-index git cherry git citool git column git credential git credential-cache git credential-store git cvsexportcommit git cvsimport git cvsserver git diff-files git diff-tree git difftool git fast-export git fetch-pack git fmt-merge-msg git get-tar-commit-id git gui git http-backend git http-fetch git http-push git imap-send git index-pack git interpret-trailers git ls-remote git ls-tree git mailinfo git mailsplit git merge-file git merge-index git merge-one-file git merge-tree git mktag git mktree git name-rev git notes git p4 git pack-objects git pack-redundant git pack-refs git parse-remote git patch-id git prune git prune-packed git quiltimport git receive-pack git remote-ext git remote-fd git remote-testgit git repack git replace git rerere git send-pack git sh-i18n git sh-setup git shell git show-branch git show-index git stripspace git unpack-file git unpack-objects git upload-archive git upload-pack git var git verify-commit git verify-tag git whatchanged git worktree Inspection and Comparison git describe git shortlog git show Miscellaneous api credentials api index gitcli gitcore tutorial gitcredentials gitcvs migration gitdiffcore githooks gitk gitnamespaces gitremote helpers gitrepository layout gitsubmodules gittutorial 2 gitweb gitweb.conf pack format User Manual Patching git apply git cherry-pick git rebase git revert Plumbing Commands git cat-file git check-ignore 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 Server Admin git daemon git update-server-info Setup and Config git git config git help Sharing and Updating Projects git fetch git pull git push git remote git submodule
文字

命名

git-cat-file  - 提供資源庫(kù)對(duì)象的內(nèi)容或類型和大小信息

概要

git cat-file (-t [--allow-unknown-type]| -s [--allow-unknown-type]| -e | -p | <type> | --textconv | --filters ) [--path=<path>] <object>git cat-file (--batch | --batch-check) [ --textconv | --filters ] [--follow-symlinks]

描述

在第一種形式中,該命令提供存儲(chǔ)庫(kù)中對(duì)象的內(nèi)容或類型。類型是必需的,除非-t-p用于查找的對(duì)象類型,或-s用于查找對(duì)象的大小,或--textconv--filters使用(其暗示型“斑點(diǎn)”)。

在第二種形式中,在 stdin 上提供了一個(gè)對(duì)象列表(由換行符分隔),每個(gè)對(duì)象的 SHA-1,類型和大小都打印在 stdout 上。使用可選<format>參數(shù)可以覆蓋輸出格式。如果指定了其中之一--textconv或者--filters被指定,則輸入需要列出對(duì)象名稱,后跟路徑名稱,并用一個(gè)空格分隔,以便可以確定適當(dāng)?shù)尿?qū)動(dòng)程序。

選項(xiàng)

<object>

要顯示的對(duì)象的名稱。有關(guān)拼寫對(duì)象名稱的更完整列表,請(qǐng)參閱 gitrevisions [7] 中的“指定修訂”部分。

-t

顯示由<object>標(biāo)識(shí)的對(duì)象類型而不是內(nèi)容。

-s

顯示由<object>標(biāo)識(shí)的對(duì)象大小,而不是內(nèi)容。

-e

控制所有輸出; 如果<object>存在并且是有效的對(duì)象,則返回零狀態(tài)。

-p

基于其類型 Pretty-print(漂亮地打印)<object>的內(nèi)容。

<type>

通常情況下,它匹配<object>的實(shí)際類型,但是要求可以輕松地從給定<object>取消引用的類型也是允許的。一個(gè)例子是要求一個(gè)“樹(shù)”,其中<object>是一個(gè)包含它的提交對(duì)象,或者要求一個(gè)<blob>作為指向它的標(biāo)記對(duì)象。

--textconv

顯示由 textconv過(guò)濾器轉(zhuǎn)換的內(nèi)容。在這種情況下,為了將過(guò)濾器應(yīng)用于記錄在<path>索引處的內(nèi)容,<object> 必須采用 <tree-ish>:<path>或<path>的形式。

--filters

顯示由當(dāng)前工作樹(shù)中為給定<路徑>配置的過(guò)濾器轉(zhuǎn)換的內(nèi)容(即涂抹過(guò)濾器,行尾轉(zhuǎn)換等)。在這種情況下,<object> 的格式必須是 <tree-ish>:<path>或<path>。

--path=<path>

與--textconv或--filters一起使用時(shí),允許單獨(dú)指定對(duì)象名稱和路徑,例如,當(dāng)難以找出 blob 來(lái)自哪個(gè)版本時(shí)。

--batch   --batch=<format>

打印 stdin 上提供的每個(gè)對(duì)象的對(duì)象信息和內(nèi)容。不能與其他選項(xiàng)或參數(shù)結(jié)合使用,除非--textconv或者--filters,在這種情況下,輸入行還需要指定由空白分隔的路徑。有關(guān)BATCH OUTPUT詳情,請(qǐng)參閱下面的部分。

--batch-check   --batch-check=<format>

打印 stdin 上提供的每個(gè)對(duì)象的對(duì)象信息。不能與其他選項(xiàng)或參數(shù)結(jié)合使用,除非--textconv或者--filters,在這種情況下,輸入行還需要指定由空白分隔的路徑。有關(guān)BATCH OUTPUT詳情,請(qǐng)參閱下面的部分。

--batch-all-objects

除了讀取 stdin 上的對(duì)象列表,還可以對(duì)存儲(chǔ)庫(kù)中的所有對(duì)象以及任何其他對(duì)象存儲(chǔ)(不僅僅是可到達(dá)的對(duì)象)執(zhí)行請(qǐng)求的批處理操作。需要--batch或被--batch-check指定。請(qǐng)注意,這些對(duì)象是按照它們的散列順序進(jìn)行訪問(wèn)的。

--buffer

在每個(gè)對(duì)象輸出后,通常會(huì)批處理輸出刷新,以便進(jìn)程可以交互式讀取和寫入cat-file。使用此選項(xiàng),輸出使用正常的stdio緩沖; 這在調(diào)用--batch-check大量對(duì)象時(shí)效率更高。

--allow-unknown-type

允許 -s 或 -t 查詢未知類型的破壞/損壞( broken/corrupt)的對(duì)象。

--follow-symlinks

使用 --batch或--batch-check,當(dāng)請(qǐng)求具有表單 tree-ish:path-in-tree 的擴(kuò)展 SHA-1 表達(dá)式的對(duì)象時(shí),請(qǐng)遵循存儲(chǔ)庫(kù)內(nèi)的符號(hào)鏈接。提供關(guān)于鏈接本身的輸出,而不是提供有關(guān)鏈接到對(duì)象的輸出。如果符號(hào)鏈接指向 tree-ish 之外(例如指向/ foo的鏈接或指向 ../foo 的根級(jí)別鏈接),則會(huì)打印樹(shù)外部分的鏈接部分。

當(dāng)索引中的對(duì)象被指定(例如,:link而不是HEAD:link)而不是樹(shù)中的一個(gè)時(shí),此選項(xiàng)不能正常工作。

除非--batch--batch-check正在使用此選項(xiàng)不能(當(dāng)前)使用。

例如,考慮一個(gè)包含以下內(nèi)容的 git 存儲(chǔ)庫(kù):

f: a file containing "hello\n"link: a symlink to f
dir/link: a symlink to ../f
plink: a symlink to ../f
alink: a symlink to /etc/passwd

對(duì)于常規(guī)文件f,echo HEAD:f | git cat-file --batch將打印

ce013625030ba8dba906f756967f9e9ca394464a blob 6

并且echo HEAD:link | git cat-file --batch --follow-symlinks會(huì)打印同樣的東西HEAD:dir/link,就像他們都指出HEAD:f的那樣。

沒(méi)有--follow-symlinks,這些將打印有關(guān)符號(hào)鏈接本身的數(shù)據(jù)。在這種情況下HEAD:link,你會(huì)看到

4d1ae35ba2c8ec712fa2a379db44ad639ca277bd blob 1

無(wú)論plinkalink點(diǎn)外樹(shù),因此他們將分別打印:

symlink 4../f
symlink 11/etc/passwd

輸出

如果-t指定了其中一個(gè)<type>。

如果-s指定,則以字節(jié)為單位的<object>的大小。

如果-e指定,則不輸出。

如果-p指定,則<object>的內(nèi)容將被打印出來(lái)。

如果指定<type>,則會(huì)返回<object>的原始(但未壓縮的)內(nèi)容。

批量輸出

如果--batch或者--batch-check給出,cat-file將從標(biāo)準(zhǔn)輸入讀取對(duì)象,每行一個(gè),并打印關(guān)于它們的信息。默認(rèn)情況下,整行被認(rèn)為是一個(gè)對(duì)象,就像它被饋送到 git-rev-parse [1] 一樣。

您可以使用自定義指定每個(gè)對(duì)象顯示的信息<format>。它<format>被逐字復(fù)制到每個(gè)對(duì)象的標(biāo)準(zhǔn)輸出中,%(atom)擴(kuò)展形式的占位符后跟一個(gè)換行符。可用的原子是:

objectname

對(duì)象的40-十六進(jìn)制對(duì)象名稱。

objecttype

對(duì)象的類型(與cat-file -t報(bào)告相同)。

objectsize

對(duì)象的大?。ㄒ宰止?jié)為單位cat-file -s)(與報(bào)告相同)。

objectsize:disk

對(duì)象在磁盤上占用的大?。ㄒ宰止?jié)為單位)。請(qǐng)參閱CAVEATS以下部分有關(guān)磁盤大小的說(shuō)明。

deltabase

如果對(duì)象存儲(chǔ)為磁盤上的增量,則此擴(kuò)展為delta基本對(duì)象的40-hex sha1。否則,展開(kāi)為 null sha1(40個(gè)零)。見(jiàn)CAVEATS下文。

rest

如果在輸出字符串中使用此原子,則會(huì)在第一個(gè)空白邊界處分割輸入行。該空白之前的所有字符都被認(rèn)為是對(duì)象名稱;在第一次運(yùn)行空白(即,線的“休息”)之后的字符被輸出以代替%(rest)原子。

如果未指定格式,則默認(rèn)格式為%(objectname) %(objecttype) %(objectsize)。

如果--batch指定,則對(duì)象信息后面是對(duì)象內(nèi)容(由%(objectsize)字節(jié)組成),后面跟著換行符。

例如,--batch沒(méi)有自定義格式會(huì)產(chǎn)生:

<sha1> SP <type> SP <size> LF<contents> LF

--batch-check='%(objectname) %(objecttype)'會(huì)產(chǎn)生:

<sha1> SP <type> LF

如果在標(biāo)準(zhǔn)輸入中指定了一個(gè)名稱,該名稱無(wú)法解析為存儲(chǔ)庫(kù)中的對(duì)象,cat-file則將忽略任何自定義格式并進(jìn)行打?。?/p>

<object> SP missing LF

如果使用--follow-symlinks,并且存儲(chǔ)庫(kù)中的符號(hào)鏈接指向存儲(chǔ)庫(kù)外部,cat-file則將忽略任何自定義格式并打?。?/p>

symlink SP <size> LF<symlink> LF

符號(hào)鏈接將是絕對(duì)的(以/開(kāi)頭),或者相對(duì)于樹(shù)根。例如,如果 dir / link 指向 ../../foo,那么<symlink>將是 ../foo。<size>是符號(hào)鏈接的大?。ㄒ宰止?jié)為單位)。

如果使用--follow-symlinks,則會(huì)顯示以下錯(cuò)誤消息:

<object> SP missing LF

在請(qǐng)求的初始符號(hào)鏈接不存在時(shí)打印。

dangling SP <size> LF<object> LF

是在初始符號(hào)鏈接存在時(shí)打印的,但它(傳遞)指向的東西沒(méi)有。

loop SP <size> LF<object> LF

是為符號(hào)鏈接循環(huán)(或任何需要超過(guò)40個(gè)鏈接分辨率才能解析的符號(hào)鏈接)打印的。

notdir SP <size> LF<object> LF

在符號(hào)鏈接解析期間,當(dāng)文件被用作目錄名稱時(shí),會(huì)打印該文件。

注意事項(xiàng)

請(qǐng)注意,磁盤上的對(duì)象大小是準(zhǔn)確報(bào)告的,但應(yīng)該小心確定哪些引用或?qū)ο筘?fù)責(zé)磁盤使用。壓縮的非 delta 對(duì)象的大小可能遠(yuǎn)遠(yuǎn)大于反對(duì)它的 delta 對(duì)象的大小,但是選擇哪個(gè)對(duì)象是基礎(chǔ),哪個(gè)是 delta 是任意的,并且在重新包裝期間可能會(huì)發(fā)生變化。

還要注意對(duì)象數(shù)據(jù)庫(kù)中可能存在多個(gè)對(duì)象副本;在這種情況下,未定義將報(bào)告哪個(gè)副本的大小或增量基數(shù)。

上一篇: 下一篇: