<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智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                # Repositories API > 原文:[https://docs.gitlab.com/ee/api/repositories.html](https://docs.gitlab.com/ee/api/repositories.html) * [List repository tree](#list-repository-tree) * [Get a blob from repository](#get-a-blob-from-repository) * [Raw blob content](#raw-blob-content) * [Get file archive](#get-file-archive) * [Compare branches, tags or commits](#compare-branches-tags-or-commits) * [Contributors](#contributors) * [Merge Base](#merge-base) # Repositories API[](#repositories-api "Permalink") ## List repository tree[](#list-repository-tree "Permalink") 獲取項目中存儲庫文件和目錄的列表. 如果可公開訪問該存儲庫,則無需身份驗證即可訪問此端點. 此命令提供的功能與`git ls-tree`命令基本相同. 有關更多信息,請參閱[Git internals 文檔](https://git-scm.com/book/en/v2/Git-Internals-Git-Objects/#_tree_objects)中的*Tree Objects*部分. ``` GET /projects/:id/repository/tree ``` Parameters: * `id` (必填)-經過身份驗證的用戶擁有[的項目](README.html#namespaced-path-encoding)的 ID 或[URL 編碼路徑](README.html#namespaced-path-encoding) * `path` (可選)-存儲庫中的路徑. 用于獲取子目錄的內容 * `ref` (可選)-存儲庫分支或標記的名稱,或者如果未提供默認分支的名稱 * `recursive` (可選)-用于獲取遞歸樹的布爾值(默認為 false) * `per_page` (可選)-每頁顯示的結果數. 如果未指定,則默認為`20` ``` [ { "id": "a1e8f8d745cc87e3a9248358d9352bb7f9a0aeba", "name": "html", "type": "tree", "path": "files/html", "mode": "040000" }, { "id": "4535904260b1082e14f867f7a24fd8c21495bde3", "name": "images", "type": "tree", "path": "files/images", "mode": "040000" }, { "id": "31405c5ddef582c5a9b7a85230413ff90e2fe720", "name": "js", "type": "tree", "path": "files/js", "mode": "040000" }, { "id": "cc71111cfad871212dc99572599a568bfe1e7e00", "name": "lfs", "type": "tree", "path": "files/lfs", "mode": "040000" }, { "id": "fd581c619bf59cfdfa9c8282377bb09c2f897520", "name": "markdown", "type": "tree", "path": "files/markdown", "mode": "040000" }, { "id": "23ea4d11a4bdd960ee5320c5cb65b5b3fdbc60db", "name": "ruby", "type": "tree", "path": "files/ruby", "mode": "040000" }, { "id": "7d70e02340bac451f281cecf0a980907974bd8be", "name": "whitespace", "type": "blob", "path": "files/whitespace", "mode": "100644" } ] ``` ## Get a blob from repository[](#get-a-blob-from-repository "Permalink") Allows you to receive information about blob in repository like size and content. Note that blob content is Base64 encoded. This endpoint can be accessed without authentication if the repository is publicly accessible. ``` GET /projects/:id/repository/blobs/:sha ``` Parameters: * `id` (必填)-經過身份驗證的用戶擁有[的項目](README.html#namespaced-path-encoding)的 ID 或[URL 編碼路徑](README.html#namespaced-path-encoding) * `sha` (必填)-Blob SHA ## Raw blob content[](#raw-blob-content "Permalink") 通過 blob SHA 獲取 blob 的原始文件內容. 如果可公開訪問該存儲庫,則無需身份驗證即可訪問此端點. ``` GET /projects/:id/repository/blobs/:sha/raw ``` Parameters: * `id` (必填)-經過身份驗證的用戶擁有[的項目](README.html#namespaced-path-encoding)的 ID 或[URL 編碼路徑](README.html#namespaced-path-encoding) * `sha` (必填)-Blob SHA ## Get file archive[](#get-file-archive "Permalink") 獲取存儲庫的存檔. 如果可公開訪問該存儲庫,則無需身份驗證即可訪問此端點. 該端點的速率限制閾值為每分鐘 5 個請求. ``` GET /projects/:id/repository/archive[.format] ``` `format`是歸檔格式的可選后綴. 默認值為`tar.gz` 選項是`tar.gz` , `tar.bz2` , `tbz` , `tbz2` , `tb2` , `bz2` , `tar`和`zip` . 例如,指定`archive.zip`將以 ZIP 格式發送存檔. Parameters: * `id` (必填)-經過身份驗證的用戶擁有[的項目](README.html#namespaced-path-encoding)的 ID 或[URL 編碼路徑](README.html#namespaced-path-encoding) * `sha` (可選)-提交要下載的 SHA. 可以使用標簽,分支引用或 SHA. 如果未指定,則默認為默認分支的尖端. 例如: ``` curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.com/api/v4/projects/<project_id>/repository/archive?sha=<commit_sha>" ``` ## Compare branches, tags or commits[](#compare-branches-tags-or-commits "Permalink") 如果可公開訪問該存儲庫,則無需身份驗證即可訪問此端點. 請注意,如果達到[差異限制](../development/diffs.html#diff-limits) ,差異可能會有一個空的差異字符串. ``` GET /projects/:id/repository/compare ``` Parameters: * `id` (必填)-經過身份驗證的用戶擁有[的項目](README.html#namespaced-path-encoding)的 ID 或[URL 編碼路徑](README.html#namespaced-path-encoding) * `from` (必填)-提交 SHA 或分支名稱 * `to` (必需)-提交 SHA 或分支名稱 * `straight` (可選)-比較方法,對于`from`和`to`之間( `from` .. `to` )之間的直接比較,為`true`對于使用合并基數( `from` ... `to` )'比較`to` `false` . 默認值為`false` . ``` GET /projects/:id/repository/compare?from=master&to=feature ``` Response: ``` { "commit": { "id": "12d65c8dd2b2676fa3ac47d955accc085a37a9c1", "short_id": "12d65c8dd2b", "title": "JS fix", "author_name": "Example User", "author_email": "user@example.com", "created_at": "2014-02-27T10:27:00+02:00" }, "commits": [{ "id": "12d65c8dd2b2676fa3ac47d955accc085a37a9c1", "short_id": "12d65c8dd2b", "title": "JS fix", "author_name": "Example User", "author_email": "user@example.com", "created_at": "2014-02-27T10:27:00+02:00" }], "diffs": [{ "old_path": "files/js/application.js", "new_path": "files/js/application.js", "a_mode": null, "b_mode": "100644", "diff": "--- a/files/js/application.js\n+++ b/files/js/application.js\n@@ -24,8 +24,10 @@\n //= require g.raphael-min\n //= require g.bar-min\n //= require branch-graph\n-//= require highlightjs.min\n-//= require ace/ace\n //= require_tree .\n //= require d3\n //= require underscore\n+\n+function fix() { \n+ alert(\"Fixed\")\n+}", "new_file": false, "renamed_file": false, "deleted_file": false }], "compare_timeout": false, "compare_same_ref": false } ``` ## Contributors[](#contributors "Permalink") 獲取存儲庫貢獻者列表. 如果可公開訪問該存儲庫,則無需身份驗證即可訪問此端點. ``` GET /projects/:id/repository/contributors ``` Parameters: * `id` (必填)-經過身份驗證的用戶擁有[的項目](README.html#namespaced-path-encoding)的 ID 或[URL 編碼路徑](README.html#namespaced-path-encoding) * `order_by` (可選)-返回按`name` , `email`或`commits` (按提交日期排序)字段排序的貢獻者. 默認為`commits` * `sort` (可選)-返回貢獻者按`asc`或`desc`順序排序. 默認為`asc` Response: ``` [{ "name": "Example User", "email": "example@example.com", "commits": 117, "additions": 2097, "deletions": 517 }, { "name": "Sample User", "email": "sample@example.com", "commits": 33, "additions": 338, "deletions": 244 }] ``` ## Merge Base[](#merge-base "Permalink") 獲取 2 個或更多引用(提交 SHA,分支名稱或標簽)的公共祖先. ``` GET /projects/:id/repository/merge_base ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 項目的 ID 或[URL 編碼的路徑](README.html#namespaced-path-encoding) | | `refs` | array | yes | 裁判找到共同的祖先,可以傳遞多個裁判 | ``` curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/repository/merge_base?refs[]=304d257dcb821665ab5110318fc58a007bd104ed&refs[]=0031876facac3f2b2702a0e53a26e89939a42209" ``` 響應示例: ``` { "id": "1a0b36b3cdad1d2ee32457c102a8c0b7056fa863", "short_id": "1a0b36b3", "title": "Initial commit", "created_at": "2014-02-27T08:03:18.000Z", "parent_ids": [], "message": "Initial commit\n", "author_name": "Example User", "author_email": "user@example.com", "authored_date": "2014-02-27T08:03:18.000Z", "committer_name": "Example User", "committer_email": "user@example.com", "committed_date": "2014-02-27T08:03:18.000Z" } ```
                  <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>

                              哎呀哎呀视频在线观看