亚洲国产日韩欧美一区二区三区,精品亚洲国产成人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-archive  - 從命名樹(shù)創(chuàng)建文件的存檔

概要

git archive [--format=<fmt>] [--list] [--prefix=<prefix>/] [<extra>]              [-o <file> | --output=<file>] [--worktree-attributes]              [--remote=<repo> [--exec=<git-upload-archive>]] <tree-ish>              [<path>…]

描述

創(chuàng)建包含指定樹(shù)的樹(shù)結(jié)構(gòu)的指定格式的存檔,并將其寫(xiě)入標(biāo)準(zhǔn)輸出。如果指定了<前綴>,則它將預(yù)置為歸檔文件中的文件名。

git archive在給定樹(shù)ID時(shí),與給定提交ID或標(biāo)簽ID時(shí)的行為不同。在第一種情況下,當(dāng)前時(shí)間用作檔案中每個(gè)文件的修改時(shí)間。在后一種情況下,將使用記錄在所引用的提交對(duì)象中的提交時(shí)間。此外,如果使用tar格式,提交ID將存儲(chǔ)在全局?jǐn)U展pax標(biāo)頭中; 它可以使用提取git get-tar-commit-id。在ZIP文件中,它被存儲(chǔ)為文件注釋。

選項(xiàng)

--format=<fmt>

結(jié)果存檔的格式:tarzip。如果沒(méi)有給出這個(gè)選項(xiàng),并且指定了輸出文件,那么如果可能的話,從文件名中推斷格式(例如,寫(xiě)入“foo.zip”使得輸出為zip格式)。否則,輸出格式是tar。

-l   --list

顯示所有可用的格式。

-v   --verbose

將進(jìn)展報(bào)告給stderr。

--prefix=<prefix>/

在檔案中的每個(gè)文件名前加上<prefix> /。

-o <file>   --output=<file>

將存檔寫(xiě)入<file>而不是stdout。

--worktree-attributes

在工作樹(shù)中查找.gitattributes文件中的屬性(請(qǐng)參閱ATTRIBUTES)。

<extra>

這可以是存檔器后端了解的任何選項(xiàng)。請(qǐng)參閱下一節(jié)。

--remote=<repo>

無(wú)需從本地存儲(chǔ)庫(kù)創(chuàng)建tar歸檔文件,可以從遠(yuǎn)程存儲(chǔ)庫(kù)中檢索tar歸檔文件。請(qǐng)注意,遠(yuǎn)程存儲(chǔ)庫(kù)可能會(huì)限制允許使用哪個(gè)sha1表達(dá)式<tree-ish>。有關(guān)詳細(xì)信息,請(qǐng)參閱git-upload-archive [1]。

--exec=<git-upload-archive>

與--remote一起用于指定git-upload-archive遠(yuǎn)程端的路徑。

<tree-ish>

該樹(shù)或承諾生成一個(gè)檔案。

<path>

如果沒(méi)有可選的路徑參數(shù),則當(dāng)前工作目錄的所有文件和子目錄都將包含在歸檔中。如果指定了一個(gè)或多個(gè)路徑,則只包含這些路徑。

后端額外選項(xiàng)

壓縮

-0

存儲(chǔ)文件而不是縮小它們。

-9

最高和最低的壓縮級(jí)別。您可以指定1到9之間的任何數(shù)字來(lái)調(diào)整壓縮速度和比率。

組態(tài)

tar.umask

這個(gè)變量可以用來(lái)限制tar歸檔項(xiàng)的權(quán)限位。默認(rèn)值是0002,這將關(guān)閉世界寫(xiě)入位。特殊值“user”表示將使用歸檔用戶的umask。有關(guān)詳細(xì)信息,請(qǐng)參閱umask(2)。如果--remote使用,則只有遠(yuǎn)程存儲(chǔ)庫(kù)的配置才會(huì)生效。

tar.<format>.command

該變量指定一個(gè)shell命令,通過(guò)該命令應(yīng)該通過(guò)其管理生成的tar輸出git archive。該命令使用帶有標(biāo)準(zhǔn)輸入上生成的tar文件的shell來(lái)執(zhí)行,并且應(yīng)該在其標(biāo)準(zhǔn)輸出上生成最終輸出。任何壓縮級(jí)別選項(xiàng)都將傳遞給命令(例如“-9”)。<format>如果沒(méi)有給出其他格式,則具有相同擴(kuò)展名的輸出文件將使用此格式。

“tar.gz”和“tgz”格式是自動(dòng)定義的,默認(rèn)為gzip -cn。您可以使用自定義命令覆蓋它們。

tar.<format>.remote

如果為true,則<format>通過(guò)git-upload-archive [1]為遠(yuǎn)程客戶端啟用。對(duì)于用戶定義的格式,默認(rèn)為false,但對(duì)于“tar.gz”和“tgz”格式則為true。

屬性

export-ignore

帶有export-ignore屬性的文件和目錄不會(huì)被添加到歸檔文件中。有關(guān)詳細(xì)信息,請(qǐng)參閱gitattributes [5]。

export-subst

如果將屬性export-subst設(shè)置為文件,那么在將該文件添加到存檔時(shí),Git將展開(kāi)多個(gè)占位符。有關(guān)詳細(xì)信息,請(qǐng)參閱gitattributes [5]。

請(qǐng)注意,屬性默認(rèn)取自.gitattributes正在歸檔的樹(shù)中的文件。如果你想調(diào)整事實(shí)后產(chǎn)生輸出的方式(例如,你沒(méi)有在其中添加一個(gè)適當(dāng)?shù)膃xport-ignore,.gitattributes.gitattributes提交),根據(jù)需要調(diào)整檢出的文件并使用--worktree-attributes選項(xiàng)?;蛘?,您可以保留在歸檔$GIT_DIR/info/attributes文件中的任何樹(shù)時(shí)應(yīng)用的必要屬性。

例子

git archive --format=tar --prefix=junk/ HEAD | (cd /var/tmp/ && tar xf -)

創(chuàng)建一個(gè)包含當(dāng)前分支上最新提交內(nèi)容的tar歸檔文件,并將其提取到/var/tmp/junk目錄中。

git archive --format=tar --prefix=git-1.4.0/ v1.4.0 | gzip >git-1.4.0.tar.gz

為v1.4.0版本創(chuàng)建一個(gè)壓縮tarball。

git archive --format=tar.gz --prefix=git-1.4.0/ v1.4.0 >git-1.4.0.tar.gz

同上,但使用內(nèi)置的tar.gz處理。

git archive --prefix=git-1.4.0/ -o git-1.4.0.tar.gz v1.4.0

與上面相同,但格式是從輸出文件中推斷出來(lái)的。

git archive --format=tar --prefix=git-1.4.0/ v1.4.0^{tree} | gzip >git-1.4.0.tar.gz

為v1.4.0發(fā)行版創(chuàng)建壓縮tarball,但沒(méi)有全局?jǐn)U展pax標(biāo)頭。

git archive --format=zip --prefix=git-docs/ HEAD:Documentation/ > git-1.4.0-docs.zip

將所有內(nèi)容放入當(dāng)前頭文件/目錄中git-1.4.0-docs.zip,并加上前綴git-docs/

git archive -o latest.zip HEAD

創(chuàng)建一個(gè)Zip存檔,其中包含當(dāng)前分支上最新提交的內(nèi)容。請(qǐng)注意,輸出格式是由輸出文件的擴(kuò)展名推斷的。

git config tar.tar.xz.command "xz -c"

配置一個(gè)“tar.xz”格式來(lái)制作LZMA壓縮的tarfiles。您可以使用它來(lái)指定--format=tar.xz或創(chuàng)建一個(gè)輸出文件-o foo.tar.xz。

Previous article: Next article: