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

directory search
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
characters

名稱

git-checkout-index  - 將索引中的文件復(fù)制到工作樹上

概要

git checkout-index [-u] [-q] [-a] [-f] [-n] [--prefix=<string>]                   [--stage=<number>|all]                   [--temp]                   [-z] [--stdin]                   [--] [<file>…]

描述

將從索引中列出的所有文件復(fù)制到工作目錄(不覆蓋現(xiàn)有文件)。

選項

-u   --index

更新索引文件中檢出條目的統(tǒng)計信息。

-q   --quiet

如果文件存在或不在索引中,請保持安靜

-f   --force

強(qiáng)制覆蓋現(xiàn)有文件

-a   --all

檢出索引中的所有文件。不能與明確的文件名一起使用。

-n   --no-create

不要簽出新文件,只刷新已經(jīng)簽出的文件。

--prefix=<string>

在創(chuàng)建文件時,請將<string>(通常是一個包含尾部/的目錄)

--stage=<number>|all

而不是檢查未合并的條目,從命名的階段復(fù)制文件。<number>必須介于1和3之間。注意:--stage = all自動表明--temp。

--temp

將文件復(fù)制到工作目錄而不是將內(nèi)容寫入臨時文件。臨時名稱關(guān)聯(lián)將寫入 stdout。

--stdin

從標(biāo)準(zhǔn)輸入中讀取路徑列表,而不是從命令行獲取路徑列表。路徑由 LF 分隔(即每行一個路徑)。

-z

只與--stdin有意義;路徑用 NUL 字符而不是 LF 分隔。

--

不要將更多的參數(shù)解釋為選項。

標(biāo)志的順序過去很重要,但現(xiàn)在不再了。

只是做git checkout-index什么都不做。你可能的意思git checkout-index -a。如果你想強(qiáng)制它,你想要的git checkout-index -f -a。

直觀性不是這里的目標(biāo)。重復(fù)性是。“沒有參數(shù)意味著沒有工作”的原因是你應(yīng)該能夠執(zhí)行的腳本:

$ find . -name '*.h' -print0 | xargs -0 git checkout-index -f --

這將強(qiáng)制所有現(xiàn)有的*.h文件被替換為它們的緩存副本。如果空的命令行暗示“全部”,那么這將強(qiáng)制刷新索引中的所有內(nèi)容,這不是重點。但是由于git checkout-index接受--stdin,使用它會更快:

$ find . -name '*.h' -print0 | git checkout-index -f -z --stdin

當(dāng)你知道剩下的將是文件名時,這--就是一個好主意;例如-a,它可以防止文件名的問題。在腳本中使用--可能是一個很好的策略。

使用--temp 或--stage = all

當(dāng)--temp被使用時(或被--stage=all表明時)git checkout-index將為每個正在簽出的索引條目創(chuàng)建一個臨時文件。該索引不會用 stat 信息更新。如果調(diào)用者需要所有未合并條目的所有階段,這些選項可能非常有用,以便可以通過外部合并工具處理未合并的文件。

列表將寫入 stdout,提供臨時文件名與跟蹤路徑名的關(guān)聯(lián)。列表格式有兩個變體:

1. tempname TAB路徑RS

第一種格式--stage是省略或不使用時使用的格式--stage=all。字段 tempname 是包含文件內(nèi)容的臨時文件名,path 是索引中的跟蹤路徑名。只輸出請求的條目。

2. stage1temp SP stage2temp SP stage3tmp TAB路徑RS

第二種格式是什么時候使用--stage=all。如果在索引.中存在階段條目或者沒有階段條目,則三個階段臨時字段(stage1temp,stage2temp,stage3temp)會列出臨時文件的名稱。只有階段0條目的路徑將始終從輸出中省略。

在這兩種格式中,默認(rèn)情況下 RS(記錄分隔符)都是換行符,但如果在命令行上傳遞-z,則將為空字節(jié)。臨時文件名總是安全的字符串; 他們將永遠(yuǎn)不會包含目錄分隔符或空白字符。路徑字段總是相對于當(dāng)前目錄,并且臨時文件名始終相對于頂級目錄。

如果被復(fù)制到臨時文件的對象是符號鏈接,則該鏈接的內(nèi)容將被寫入普通文件。終端用戶或瓷器會使用這些信息。

示例

僅更新和刷新已檢出的文件

$ git checkout-index -n -f -a && git update-index --ignore-missing --refresh

使用 git checkout-index 來“導(dǎo)出整個樹”

前綴能力基本上使它git checkout-index作為一個“導(dǎo)出為樹”函數(shù)使用很簡單。只需在索引中讀取所需的樹,然后執(zhí)行:

$ git checkout-index --prefix=git-export-dir/ -a

git checkout-index 會將索引“導(dǎo)出”到指定的目錄中。

最后的“/”很重要。導(dǎo)出的名稱實際上只是以指定的字符串作為前綴。將此與以下示例進(jìn)行對比。

用前綴導(dǎo)出文件

$ git checkout-index --prefix=.merged- Makefile

這將檢出當(dāng)前緩存Makefile.merged-Makefile文件中的副本。

Previous article: Next article: