<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                # git-archive > 原文: [https://git-scm.com/docs/git-archive](https://git-scm.com/docs/git-archive) ## 名稱 git-archive - 從命名樹創建文件存檔 ## 概要 ``` git archive [--format=<fmt>] [--list] [--prefix=<prefix>/] [<extra>] [-o <file> | --output=<file>] [--worktree-attributes] [--remote=<repo> [--exec=<git-upload-archive>]] <tree-ish> [<path>…?] ``` ## 描述 創建包含指定樹的樹結構的指定格式的存檔,并將其寫入標準輸出。如果&lt;前綴&gt;指定它被添加到存檔中的文件名前面。 _git archive_ 在給定樹ID時與給定提交ID或標記ID時的行為不同。在第一種情況下,當前時間用作存檔中每個文件的修改時間。在后一種情況下,使用引用的提交對象中記錄的提交時間。另外,如果使用tar格式,則提交ID存儲在全局擴展pax頭中;它可以使用 _git get-tar-commit-id_ 提取。在ZIP文件中,它存儲為文件注釋。 ## OPTIONS ``` --format=<fmt> ``` 生成的存檔的格式: _tar_ 或 _zip_ 。如果未給出此選項,并且指定了輸出文件,則盡可能從文件名推斷格式(例如,寫入“foo.zip”使輸出為zip格式)。否則輸出格式為`tar`。 ``` -l ``` ``` --list ``` 顯示所有可用格式。 ``` -v ``` ``` --verbose ``` 向stderr報告進度。 ``` --prefix=<prefix>/ ``` 將&lt;前綴&gt; /前置到存檔中的每個文件名。 ``` -o <file> ``` ``` --output=<file> ``` 將存檔寫入&lt; file&gt;而不是stdout。 ``` --worktree-attributes ``` 在工作樹中查找.gitattributes文件中的屬性(參見 [ATTRIBUTES](#ATTRIBUTES) )。 ``` <extra> ``` 這可以是歸檔后端理解的任何選項。見下一節。 ``` --remote=<repo> ``` 而不是從本地存儲庫創建tar存檔,從遠程存儲庫中檢索tar存檔。請注意,遠程存儲庫可能會限制`&lt;tree-ish&gt;`中允許哪些sha1表達式。有關詳細信息,請參閱 [git-upload-archive [1]](https://git-scm.com/docs/git-upload-archive) 。 ``` --exec=<git-upload-archive> ``` 與--remote一起使用以指定遠程端的 _git-upload-archive_ 的路徑。 ``` <tree-ish> ``` 樹或承諾為其生成存檔。 ``` <path> ``` 如果沒有可選的路徑參數,則當前工作目錄的所有文件和子目錄都將包含在存檔中。如果指定了一個或多個路徑,則僅包括這些路徑。 ## 備用額外選項 ### 壓縮 ``` -0 ``` 存儲文件而不是縮小文件。 ``` -9 ``` 最高和最慢的壓縮級別。您可以指定1到9之間的任意數字來調整壓縮速度和比率。 ## 組態 ``` tar.umask ``` 此變量可用于限制tar存檔條目的權限位。默認值為0002,關閉世界寫入位。特殊值“user”表示將使用歸檔用戶的umask。有關詳細信息,請參閱umask(2)。如果使用`--remote`,則只有遠程存儲庫的配置生效。 ``` tar.<format>.command ``` 此變量指定一個shell命令,通過該命令管道`git archive`生成的tar輸出。該命令是使用shell在其標準輸入上生成的tar文件執行的,并應在其標準輸出上生成最終輸出。任何壓縮級選項都將傳遞給命令(例如,“ - 9”)。如果沒有給出其他格式,則與`&lt;format&gt;`具有相同擴展名的輸出文件將使用此格式。 “tar.gz”和“tgz”格式是自動定義的,默認為`gzip -cn`。您可以使用自定義命令覆蓋它們。 ``` tar.<format>.remote ``` 如果為true,則啟用`&lt;format&gt;`以供遠程客戶端通過 [git-upload-archive [1]](https://git-scm.com/docs/git-upload-archive) 使用。對于用戶定義的格式,默認為false,但對于“tar.gz”和“tgz”格式,則為true。 ## ATTRIBUTES ``` export-ignore ``` 具有export-ignore屬性的文件和目錄不會添加到存檔文件中。有關詳細信息,請參閱 [gitattributes [5]](https://git-scm.com/docs/gitattributes) 。 ``` export-subst ``` 如果為文件設置了export-subst屬性,那么在將此文件添加到存檔時,Git將展開多個占位符。有關詳細信息,請參閱 [gitattributes [5]](https://git-scm.com/docs/gitattributes) 。 請注意,默認情況下,屬性取自正在歸檔的樹中的`.gitattributes`文件。如果您想調整事后生成輸出的方式(例如,您在`.gitattributes`中未添加適當的export-ignore而提交),請根據需要調整簽出的`.gitattributes`文件并使用`--worktree-attributes`選項。或者,您可以在歸檔`$GIT_DIR/info/attributes`文件中的任何樹時保留應該應用的必要屬性。 ## 例子 ``` git archive --format=tar --prefix=junk/ HEAD | (cd /var/tmp/ && tar xf -) ``` 創建一個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版本創建壓縮的tarball。 ``` git archive --format=tar.gz --prefix=git-1.4.0/ v1.4.0 >git-1.4.0.tar.gz ``` 與上面相同,但使用內置的tar.gz處理。 ``` git archive --prefix=git-1.4.0/ -o git-1.4.0.tar.gz v1.4.0 ``` 與上面相同,但是從輸出文件中推斷出格式。 ``` git archive --format=tar --prefix=git-1.4.0/ v1.4.0^{tree} | gzip >git-1.4.0.tar.gz ``` 為v1.4.0發行版創建壓縮的tarball,但沒有全局擴展的pax標頭。 ``` git archive --format=zip --prefix=git-docs/ HEAD:Documentation/ > git-1.4.0-docs.zip ``` 將當前頭文檔/目錄中的所有內容放入 _git-1.4.0-docs.zip_ ,前綴為 _git-docs /_ 。 ``` git archive -o latest.zip HEAD ``` 創建一個Zip存檔,其中包含當前分支上最新提交的內容。請注意,輸出格式是由輸出文件的擴展名推斷的。 ``` git config tar.tar.xz.command "xz -c" ``` 配置“tar.xz”格式以生成LZMA壓縮的tarfiles。您可以使用它指定`--format=tar.xz`,或創建類似`-o foo.tar.xz`的輸出文件。 ## 也可以看看 [gitattributes [5]](https://git-scm.com/docs/gitattributes) ## GIT 部分 [git [1]](https://git-scm.com/docs/git) 套件
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看