# Projects API
> 原文:[https://docs.gitlab.com/ee/api/projects.html](https://docs.gitlab.com/ee/api/projects.html)
* [Project visibility level](#project-visibility-level)
* [Project merge method](#project-merge-method)
* [List all projects](#list-all-projects)
* [Pagination limits](#pagination-limits)
* [List user projects](#list-user-projects)
* [List projects starred by a user](#list-projects-starred-by-a-user)
* [Get single project](#get-single-project)
* [Get project users](#get-project-users)
* [Get project events](#get-project-events)
* [Create project](#create-project)
* [Create project for user](#create-project-for-user)
* [Edit project](#edit-project)
* [Fork project](#fork-project)
* [List Forks of a project](#list-forks-of-a-project)
* [Star a project](#star-a-project)
* [Unstar a project](#unstar-a-project)
* [List Starrers of a project](#list-starrers-of-a-project)
* [Languages](#languages)
* [Archive a project](#archive-a-project)
* [Unarchive a project](#unarchive-a-project)
* [Remove project](#remove-project)
* [Restore project marked for deletion](#restore-project-marked-for-deletion-premium)
* [Upload a file](#upload-a-file)
* [Share project with group](#share-project-with-group)
* [Delete a shared project link within a group](#delete-a-shared-project-link-within-a-group)
* [Hooks](#hooks)
* [List project hooks](#list-project-hooks)
* [Get project hook](#get-project-hook)
* [Add project hook](#add-project-hook)
* [Edit project hook](#edit-project-hook)
* [Delete project hook](#delete-project-hook)
* [Fork relationship](#fork-relationship)
* [Create a forked from/to relation between existing projects](#create-a-forked-fromto-relation-between-existing-projects)
* [Delete an existing forked from relationship](#delete-an-existing-forked-from-relationship)
* [Search for projects by name](#search-for-projects-by-name)
* [Start the Housekeeping task for a Project](#start-the-housekeeping-task-for-a-project)
* [Push Rules](#push-rules-starter)
* [Get project push rules](#get-project-push-rules)
* [Add project push rule](#add-project-push-rule)
* [Edit project push rule](#edit-project-push-rule)
* [Delete project push rule](#delete-project-push-rule)
* [Transfer a project to a new namespace](#transfer-a-project-to-a-new-namespace)
* [Branches](#branches)
* [Project Import/Export](#project-importexport)
* [Project members](#project-members)
* [Start the pull mirroring process for a Project](#start-the-pull-mirroring-process-for-a-project-starter)
* [Project badges](#project-badges)
* [Issue and merge request description templates](#issue-and-merge-request-description-templates)
* [Download snapshot of a Git repository](#download-snapshot-of-a-git-repository)
# Projects API[](#projects-api "Permalink")
## Project visibility level[](#project-visibility-level "Permalink")
GitLab 中的項目可以是私有的,內部的或公共的. 這由項目中的`visibility`字段確定.
項目可見性級別的值為:
* `private` :必須為每個用戶顯式授予項目訪問權限.
* `internal` :任何登錄的用戶都可以克隆該項目.
* `public` :無需任何身份驗證即可訪問該項目.
## Project merge method[](#project-merge-method "Permalink")
`merge_method`當前有三個選項可供選擇:
* `merge` :為每個合并創建一個合并提交,只要沒有沖突就允許合并.
* `rebase_merge` :為每個合并創建一個合并提交,但是僅當可能進行快速合并時才允許合并. 這樣,您可以確保在合并到目標分支后,如果此合并請求將生成,則該請求也將生成.
* `ff` :沒有創建合并提交,并且所有合并都被快速轉發,這意味著僅當分支可以被快速轉發時才允許合并.
## List all projects[](#list-all-projects "Permalink")
獲取已認證用戶跨 GitLab 的所有可見項目的列表. 在未經身份驗證的情況下訪問時,僅返回帶有"簡單"字段的公共項目.
```
GET /projects
```
| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `archived` | boolean | no | 受存檔狀態限制 |
| `visibility` | string | no | 受`public` , `internal`或`private`可見性的限制 |
| `order_by` | string | no | 返回按`id` , `name` , `path` , `created_at` , `updated_at`或`last_activity_at`字段排序的項目. 只有管??理員可以使用`repository_size` , `storage_size`或`wiki_size`字段. 默認為`created_at` |
| `sort` | string | no | 返回按`asc`或`desc`順序排序的項目. 默認為`desc` |
| `search` | string | no | 返回符合搜索條件的項目列表 |
| `search_namespaces` | boolean | no | 匹配搜索條件時包括祖先名稱空間. 默認為`false` |
| `simple` | boolean | no | 僅返回每個項目的有限字段. 這是沒有身份驗證的無操作操作,因為這樣*只會*返回簡單的字段. |
| `owned` | boolean | no | 受當前用戶明確擁有的項目限制 |
| `membership` | boolean | no | 受當前用戶是其成員的項目的限制 |
| `starred` | boolean | no | 受當前用戶加注星標的項目限制 |
| `statistics` | boolean | no | 包括項目統計 |
| `with_custom_attributes` | boolean | no | 在響應中包括[自定義屬性](custom_attributes.html) (僅管理員) |
| `with_issues_enabled` | boolean | no | 受啟用的問題限制功能 |
| `with_merge_requests_enabled` | boolean | no | 通過啟用的合并請求限制功能 |
| `with_programming_language` | string | no | 受使用給定編程語言的項目限制 |
| `wiki_checksum_failed` | boolean | no | 限制維基校驗和計算失敗的項目(在[GitLab Premium](https://about.gitlab.com/pricing/) 11.2 中[引入](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/6137) ) |
| `repository_checksum_failed` | boolean | no | 限制存儲庫校驗和計算失敗的項目(在[GitLab Premium](https://about.gitlab.com/pricing/) 11.2 中[引入](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/6137) ) |
| `min_access_level` | integer | no | 受當前用戶的最小[訪問權限](members.html)限制 |
| `id_after` | integer | no | 將結果限制為 ID 大于指定 ID 的項目 |
| `id_before` | integer | no | 將結果限制為 ID 小于指定 ID 的項目 |
| `last_activity_after` | datetime | no | 在指定時間后,將結果限制為具有 last_activity 的項目. 格式:ISO 8601 YYYY-MM-DDTHH:MM:SSZ |
| `last_activity_before` | datetime | no | 將結果限制為在指定時間之前具有 last_activity 的項目. 格式:ISO 8601 YYYY-MM-DDTHH:MM:SSZ |
| `repository_storage` | string | no | 將結果限制為存儲在 repository_storage 上的項目. 僅適用于管理員. |
**注意:**此端點支持所選`order_by`選項的[鍵集分頁](README.html#keyset-based-pagination) .
當`simple=true`或用戶未經身份驗證時,這將返回如下內容:
```
[ { "id": 4, "description": null, "default_branch": "master", "ssh_url_to_repo": "git@example.com:diaspora/diaspora-client.git", "http_url_to_repo": "http://example.com/diaspora/diaspora-client.git", "web_url": "http://example.com/diaspora/diaspora-client", "readme_url": "http://example.com/diaspora/diaspora-client/blob/master/README.md", "tag_list": [ "example", "disapora client" ], "name": "Diaspora Client", "name_with_namespace": "Diaspora / Diaspora Client", "path": "diaspora-client", "path_with_namespace": "diaspora/diaspora-client", "created_at": "2013-09-30T13:46:02Z", "last_activity_at": "2013-09-30T13:46:02Z", "forks_count": 0, "avatar_url": "http://example.com/uploads/project/avatar/4/uploads/avatar.png", "star_count": 0, }, { "id": 6, "description": null, "default_branch": "master", ...
```
當用戶通過身份驗證且未設置`simple` ,將返回以下內容:
```
[ { "id": 4, "description": null, "default_branch": "master", "visibility": "private", "ssh_url_to_repo": "git@example.com:diaspora/diaspora-client.git", "http_url_to_repo": "http://example.com/diaspora/diaspora-client.git", "web_url": "http://example.com/diaspora/diaspora-client", "readme_url": "http://example.com/diaspora/diaspora-client/blob/master/README.md", "tag_list": [ "example", "disapora client" ], "owner": { "id": 3, "name": "Diaspora", "created_at": "2013-09-30T13:46:02Z" }, "name": "Diaspora Client", "name_with_namespace": "Diaspora / Diaspora Client", "path": "diaspora-client", "path_with_namespace": "diaspora/diaspora-client", "issues_enabled": true, "open_issues_count": 1, "merge_requests_enabled": true, "jobs_enabled": true, "wiki_enabled": true, "snippets_enabled": false, "can_create_merge_request_in": true, "resolve_outdated_diff_discussions": false, "container_registry_enabled": false, "created_at": "2013-09-30T13:46:02Z", "last_activity_at": "2013-09-30T13:46:02Z", "creator_id": 3, "namespace": { "id": 3, "name": "Diaspora", "path": "diaspora", "kind": "group", "full_path": "diaspora" }, "import_status": "none", "archived": false, "avatar_url": "http://example.com/uploads/project/avatar/4/uploads/avatar.png", "shared_runners_enabled": true, "forks_count": 0, "star_count": 0, "runners_token": "b8547b1dc37721d05889db52fa2f02", "ci_default_git_depth": 50, "public_jobs": true, "shared_with_groups": [], "only_allow_merge_if_pipeline_succeeds": false, "allow_merge_on_skipped_pipeline": false, "only_allow_merge_if_all_discussions_are_resolved": false, "remove_source_branch_after_merge": false, "request_access_enabled": false, "merge_method": "merge", "autoclose_referenced_issues": true, "suggestion_commit_message": null, "marked_for_deletion_at": "2020-04-03", // Deprecated and will be removed in API v5 in favor of marked_for_deletion_on "marked_for_deletion_on": "2020-04-03", "statistics": { "commit_count": 37, "storage_size": 1038090, "repository_size": 1038090, "wiki_size" : 0, "lfs_objects_size": 0, "job_artifacts_size": 0, "packages_size": 0 }, "_links": { "self": "http://example.com/api/v4/projects", "issues": "http://example.com/api/v4/projects/1/issues", "merge_requests": "http://example.com/api/v4/projects/1/merge_requests", "repo_branches": "http://example.com/api/v4/projects/1/repository_branches", "labels": "http://example.com/api/v4/projects/1/labels", "events": "http://example.com/api/v4/projects/1/events", "members": "http://example.com/api/v4/projects/1/members" }, }, { "id": 6, "description": null, "default_branch": "master", "visibility": "private", "ssh_url_to_repo": "git@example.com:brightbox/puppet.git", "http_url_to_repo": "http://example.com/brightbox/puppet.git", "web_url": "http://example.com/brightbox/puppet", "readme_url": "http://example.com/brightbox/puppet/blob/master/README.md", "tag_list": [ "example", "puppet" ], "owner": { "id": 4, "name": "Brightbox", "created_at": "2013-09-30T13:46:02Z" }, "name": "Puppet", "name_with_namespace": "Brightbox / Puppet", "path": "puppet", "path_with_namespace": "brightbox/puppet", "issues_enabled": true, "open_issues_count": 1, "merge_requests_enabled": true, "jobs_enabled": true, "wiki_enabled": true, "snippets_enabled": false, "can_create_merge_request_in": true, "resolve_outdated_diff_discussions": false, "container_registry_enabled": false, "created_at": "2013-09-30T13:46:02Z", "last_activity_at": "2013-09-30T13:46:02Z", "creator_id": 3, "namespace": { "id": 4, "name": "Brightbox", "path": "brightbox", "kind": "group", "full_path": "brightbox" }, "import_status": "none", "import_error": null, "permissions": { "project_access": { "access_level": 10, "notification_level": 3 }, "group_access": { "access_level": 50, "notification_level": 3 } }, "archived": false, "avatar_url": null, "shared_runners_enabled": true, "forks_count": 0, "star_count": 0, "runners_token": "b8547b1dc37721d05889db52fa2f02", "ci_default_git_depth": 0, "public_jobs": true, "shared_with_groups": [], "only_allow_merge_if_pipeline_succeeds": false, "allow_merge_on_skipped_pipeline": false, "only_allow_merge_if_all_discussions_are_resolved": false, "remove_source_branch_after_merge": false, "request_access_enabled": false, "merge_method": "merge", "auto_devops_enabled": true, "auto_devops_deploy_strategy": "continuous", "repository_storage": "default", "approvals_before_merge": 0, "mirror": false, "mirror_user_id": 45, "mirror_trigger_builds": false, "only_mirror_protected_branches": false, "mirror_overwrites_diverged_branches": false, "external_authorization_classification_label": null, "packages_enabled": true, "service_desk_enabled": false, "service_desk_address": null, "autoclose_referenced_issues": true, "suggestion_commit_message": null, "statistics": { "commit_count": 12, "storage_size": 2066080, "repository_size": 2066080, "wiki_size" : 0, "lfs_objects_size": 0, "job_artifacts_size": 0, "packages_size": 0 }, "_links": { "self": "http://example.com/api/v4/projects", "issues": "http://example.com/api/v4/projects/1/issues", "merge_requests": "http://example.com/api/v4/projects/1/merge_requests", "repo_branches": "http://example.com/api/v4/projects/1/repository_branches", "labels": "http://example.com/api/v4/projects/1/labels", "events": "http://example.com/api/v4/projects/1/events", "members": "http://example.com/api/v4/projects/1/members" } } ]
```
**注意:**對于使用 GitLab [Silver,Premium 或更高版本](https://about.gitlab.com/pricing/)的用戶[,](https://about.gitlab.com/pricing/)已不推薦使用`marked_for_deletion_at`屬性,并將在 API v5 中將其刪除,以支持`marked_for_deletion_on`屬性.
在 GitLab 用戶[入門,青銅或更高](https://about.gitlab.com/pricing/)還會看到`approvals_before_merge`參數:
```
[ { "id": 4, "description": null, "approvals_before_merge": 0, ... } ]
```
您可以使用以下[自定義屬性](custom_attributes.html)進行過濾:
```
GET /projects?custom_attributes[key]=value&custom_attributes[other_key]=other_value
```
### Pagination limits[](#pagination-limits "Permalink")
從 GitLab 13.0 開始, [基于偏移量的分頁](README.html#offset-based-pagination)將被[限制為 50,000 條記錄](https://gitlab.com/gitlab-org/gitlab/-/issues/34565) . 要檢索超出此限制的項目,將需要進行[鍵集分頁](README.html#keyset-based-pagination) .
請注意,鍵集分頁僅支持`order_by=id` . 其他排序選項不可用.
## List user projects[](#list-user-projects "Permalink")
獲取給定用戶擁有的可見項目的列表. 在未經身份驗證的情況下訪問時,僅返回公共項目.
```
GET /users/:user_id/projects
```
| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `user_id` | string | yes | 用戶的 ID 或用戶名 |
| `archived` | boolean | no | 受存檔狀態限制 |
| `visibility` | string | no | 受`public` , `internal`或`private`可見性的限制 |
| `order_by` | string | no | 返回按`id` , `name` , `path` , `created_at` , `updated_at`或`last_activity_at`字段排序的項目. 默認為`created_at` |
| `sort` | string | no | 返回按`asc`或`desc`順序排序的項目. 默認為`desc` |
| `search` | string | no | 返回符合搜索條件的項目列表 |
| `simple` | boolean | no | 僅返回每個項目的有限字段. 這是沒有身份驗證的無操作操作,因為這樣*只會*返回簡單的字段. |
| `owned` | boolean | no | 受當前用戶明確擁有的項目限制 |
| `membership` | boolean | no | 受當前用戶是其成員的項目的限制 |
| `starred` | boolean | no | Limit by projects starred by the current user |
| `statistics` | boolean | no | 包括項目統計 |
| `with_custom_attributes` | boolean | no | 在響應中包括[自定義屬性](custom_attributes.html) (僅管理員) |
| `with_issues_enabled` | boolean | no | 受啟用的問題限制功能 |
| `with_merge_requests_enabled` | boolean | no | 通過啟用的合并請求限制功能 |
| `with_programming_language` | string | no | 受使用給定編程語言的項目限制 |
| `min_access_level` | integer | no | 受當前用戶的最小[訪問權限](members.html)限制 |
| `id_after` | integer | no | 將結果限制為 ID 大于指定 ID 的項目 |
| `id_before` | integer | no | 將結果限制為 ID 小于指定 ID 的項目 |
**注意:**此端點支持所選`order_by`選項的[鍵集分頁](README.html#keyset-based-pagination) .
```
[ { "id": 4, "description": null, "default_branch": "master", "visibility": "private", "ssh_url_to_repo": "git@example.com:diaspora/diaspora-client.git", "http_url_to_repo": "http://example.com/diaspora/diaspora-client.git", "web_url": "http://example.com/diaspora/diaspora-client", "readme_url": "http://example.com/diaspora/diaspora-client/blob/master/README.md", "tag_list": [ "example", "disapora client" ], "owner": { "id": 3, "name": "Diaspora", "created_at": "2013-09-30T13:46:02Z" }, "name": "Diaspora Client", "name_with_namespace": "Diaspora / Diaspora Client", "path": "diaspora-client", "path_with_namespace": "diaspora/diaspora-client", "issues_enabled": true, "open_issues_count": 1, "merge_requests_enabled": true, "jobs_enabled": true, "wiki_enabled": true, "snippets_enabled": false, "can_create_merge_request_in": true, "resolve_outdated_diff_discussions": false, "container_registry_enabled": false, "created_at": "2013-09-30T13:46:02Z", "last_activity_at": "2013-09-30T13:46:02Z", "creator_id": 3, "namespace": { "id": 3, "name": "Diaspora", "path": "diaspora", "kind": "group", "full_path": "diaspora" }, "import_status": "none", "archived": false, "avatar_url": "http://example.com/uploads/project/avatar/4/uploads/avatar.png", "shared_runners_enabled": true, "forks_count": 0, "star_count": 0, "runners_token": "b8547b1dc37721d05889db52fa2f02", "ci_default_git_depth": 50, "public_jobs": true, "shared_with_groups": [], "only_allow_merge_if_pipeline_succeeds": false, "allow_merge_on_skipped_pipeline": false, "only_allow_merge_if_all_discussions_are_resolved": false, "remove_source_branch_after_merge": false, "request_access_enabled": false, "merge_method": "merge", "autoclose_referenced_issues": true, "suggestion_commit_message": null, "marked_for_deletion_at": "2020-04-03", // Deprecated and will be removed in API v5 in favor of marked_for_deletion_on "marked_for_deletion_on": "2020-04-03", "statistics": { "commit_count": 37, "storage_size": 1038090, "repository_size": 1038090, "wiki_size" : 0, "lfs_objects_size": 0, "job_artifacts_size": 0, "packages_size": 0 }, "_links": { "self": "http://example.com/api/v4/projects", "issues": "http://example.com/api/v4/projects/1/issues", "merge_requests": "http://example.com/api/v4/projects/1/merge_requests", "repo_branches": "http://example.com/api/v4/projects/1/repository_branches", "labels": "http://example.com/api/v4/projects/1/labels", "events": "http://example.com/api/v4/projects/1/events", "members": "http://example.com/api/v4/projects/1/members" } }, { "id": 6, "description": null, "default_branch": "master", "visibility": "private", "ssh_url_to_repo": "git@example.com:brightbox/puppet.git", "http_url_to_repo": "http://example.com/brightbox/puppet.git", "web_url": "http://example.com/brightbox/puppet", "readme_url": "http://example.com/brightbox/puppet/blob/master/README.md", "tag_list": [ "example", "puppet" ], "owner": { "id": 4, "name": "Brightbox", "created_at": "2013-09-30T13:46:02Z" }, "name": "Puppet", "name_with_namespace": "Brightbox / Puppet", "path": "puppet", "path_with_namespace": "brightbox/puppet", "issues_enabled": true, "open_issues_count": 1, "merge_requests_enabled": true, "jobs_enabled": true, "wiki_enabled": true, "snippets_enabled": false, "can_create_merge_request_in": true, "resolve_outdated_diff_discussions": false, "container_registry_enabled": false, "created_at": "2013-09-30T13:46:02Z", "last_activity_at": "2013-09-30T13:46:02Z", "creator_id": 3, "namespace": { "id": 4, "name": "Brightbox", "path": "brightbox", "kind": "group", "full_path": "brightbox" }, "import_status": "none", "import_error": null, "permissions": { "project_access": { "access_level": 10, "notification_level": 3 }, "group_access": { "access_level": 50, "notification_level": 3 } }, "archived": false, "avatar_url": null, "shared_runners_enabled": true, "forks_count": 0, "star_count": 0, "runners_token": "b8547b1dc37721d05889db52fa2f02", "ci_default_git_depth": 0, "public_jobs": true, "shared_with_groups": [], "only_allow_merge_if_pipeline_succeeds": false, "allow_merge_on_skipped_pipeline": false, "only_allow_merge_if_all_discussions_are_resolved": false, "remove_source_branch_after_merge": false, "request_access_enabled": false, "merge_method": "merge", "auto_devops_enabled": true, "auto_devops_deploy_strategy": "continuous", "repository_storage": "default", "approvals_before_merge": 0, "mirror": false, "mirror_user_id": 45, "mirror_trigger_builds": false, "only_mirror_protected_branches": false, "mirror_overwrites_diverged_branches": false, "external_authorization_classification_label": null, "packages_enabled": true, "service_desk_enabled": false, "service_desk_address": null, "autoclose_referenced_issues": true, "suggestion_commit_message": null, "statistics": { "commit_count": 12, "storage_size": 2066080, "repository_size": 2066080, "wiki_size" : 0, "lfs_objects_size": 0, "job_artifacts_size": 0, "packages_size": 0 }, "_links": { "self": "http://example.com/api/v4/projects", "issues": "http://example.com/api/v4/projects/1/issues", "merge_requests": "http://example.com/api/v4/projects/1/merge_requests", "repo_branches": "http://example.com/api/v4/projects/1/repository_branches", "labels": "http://example.com/api/v4/projects/1/labels", "events": "http://example.com/api/v4/projects/1/events", "members": "http://example.com/api/v4/projects/1/members" } } ]
```
## List projects starred by a user[](#list-projects-starred-by-a-user "Permalink")
獲取給定用戶擁有的可見項目的列表. 在未經身份驗證的情況下訪問時,僅返回公共項目.
```
GET /users/:user_id/starred_projects
```
| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `user_id` | string | yes | 用戶的 ID 或用戶名. |
| `archived` | boolean | no | 受存檔狀態限制. |
| `visibility` | string | no | 受`public` , `internal`或`private`可見性的限制. |
| `order_by` | string | no | 返回按`id` , `name` , `path` , `created_at` , `updated_at`或`last_activity_at`字段排序的項目. 默認值為`created_at` . |
| `sort` | string | no | 返回按`asc`或`desc`順序排序的項目. 默認為`desc` . |
| `search` | string | no | 返回符合搜索條件的項目列表. |
| `simple` | boolean | no | 僅返回每個項目的有限字段. 這是沒有身份驗證的無操作操作,因為*僅*返回簡單字段. |
| `owned` | boolean | no | 受當前用戶明確擁有的項目限制. |
| `membership` | boolean | no | 受當前用戶所屬項目的限制. |
| `starred` | boolean | no | 受當前用戶加注星標的項目限制. |
| `statistics` | boolean | no | 包括項目統計信息. |
| `with_custom_attributes` | boolean | no | 在響應中包括[自定義屬性](custom_attributes.html) (僅管理員). |
| `with_issues_enabled` | boolean | no | 受啟用的問題限制功能. |
| `with_merge_requests_enabled` | boolean | no | 通過啟用的合并請求限制功能. |
| `min_access_level` | integer | no | 受當前用戶的最小[訪問權限](members.html)限制. |
```
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/users/5/starred_projects"
```
響應示例:
```
[ { "id": 4, "description": null, "default_branch": "master", "visibility": "private", "ssh_url_to_repo": "git@example.com:diaspora/diaspora-client.git", "http_url_to_repo": "http://example.com/diaspora/diaspora-client.git", "web_url": "http://example.com/diaspora/diaspora-client", "readme_url": "http://example.com/diaspora/diaspora-client/blob/master/README.md", "tag_list": [ "example", "disapora client" ], "owner": { "id": 3, "name": "Diaspora", "created_at": "2013-09-30T13:46:02Z" }, "name": "Diaspora Client", "name_with_namespace": "Diaspora / Diaspora Client", "path": "diaspora-client", "path_with_namespace": "diaspora/diaspora-client", "issues_enabled": true, "open_issues_count": 1, "merge_requests_enabled": true, "jobs_enabled": true, "wiki_enabled": true, "snippets_enabled": false, "can_create_merge_request_in": true, "resolve_outdated_diff_discussions": false, "container_registry_enabled": false, "created_at": "2013-09-30T13:46:02Z", "last_activity_at": "2013-09-30T13:46:02Z", "creator_id": 3, "namespace": { "id": 3, "name": "Diaspora", "path": "diaspora", "kind": "group", "full_path": "diaspora" }, "import_status": "none", "archived": false, "avatar_url": "http://example.com/uploads/project/avatar/4/uploads/avatar.png", "shared_runners_enabled": true, "forks_count": 0, "star_count": 0, "runners_token": "b8547b1dc37721d05889db52fa2f02", "public_jobs": true, "shared_with_groups": [], "only_allow_merge_if_pipeline_succeeds": false, "allow_merge_on_skipped_pipeline": false, "only_allow_merge_if_all_discussions_are_resolved": false, "remove_source_branch_after_merge": false, "request_access_enabled": false, "merge_method": "merge", "autoclose_referenced_issues": true, "suggestion_commit_message": null, "statistics": { "commit_count": 37, "storage_size": 1038090, "repository_size": 1038090, "lfs_objects_size": 0, "job_artifacts_size": 0 }, "_links": { "self": "http://example.com/api/v4/projects", "issues": "http://example.com/api/v4/projects/1/issues", "merge_requests": "http://example.com/api/v4/projects/1/merge_requests", "repo_branches": "http://example.com/api/v4/projects/1/repository_branches", "labels": "http://example.com/api/v4/projects/1/labels", "events": "http://example.com/api/v4/projects/1/events", "members": "http://example.com/api/v4/projects/1/members" } }, { "id": 6, "description": null, "default_branch": "master", "visibility": "private", "ssh_url_to_repo": "git@example.com:brightbox/puppet.git", "http_url_to_repo": "http://example.com/brightbox/puppet.git", "web_url": "http://example.com/brightbox/puppet", "readme_url": "http://example.com/brightbox/puppet/blob/master/README.md", "tag_list": [ "example", "puppet" ], "owner": { "id": 4, "name": "Brightbox", "created_at": "2013-09-30T13:46:02Z" }, "name": "Puppet", "name_with_namespace": "Brightbox / Puppet", "path": "puppet", "path_with_namespace": "brightbox/puppet", "issues_enabled": true, "open_issues_count": 1, "merge_requests_enabled": true, "jobs_enabled": true, "wiki_enabled": true, "snippets_enabled": false, "can_create_merge_request_in": true, "resolve_outdated_diff_discussions": false, "container_registry_enabled": false, "created_at": "2013-09-30T13:46:02Z", "last_activity_at": "2013-09-30T13:46:02Z", "creator_id": 3, "namespace": { "id": 4, "name": "Brightbox", "path": "brightbox", "kind": "group", "full_path": "brightbox" }, "import_status": "none", "import_error": null, "permissions": { "project_access": { "access_level": 10, "notification_level": 3 }, "group_access": { "access_level": 50, "notification_level": 3 } }, "archived": false, "avatar_url": null, "shared_runners_enabled": true, "forks_count": 0, "star_count": 0, "runners_token": "b8547b1dc37721d05889db52fa2f02", "public_jobs": true, "shared_with_groups": [], "only_allow_merge_if_pipeline_succeeds": false, "allow_merge_on_skipped_pipeline": false, "only_allow_merge_if_all_discussions_are_resolved": false, "remove_source_branch_after_merge": false, "request_access_enabled": false, "merge_method": "merge", "auto_devops_enabled": true, "auto_devops_deploy_strategy": "continuous", "repository_storage": "default", "approvals_before_merge": 0, "mirror": false, "mirror_user_id": 45, "mirror_trigger_builds": false, "only_mirror_protected_branches": false, "mirror_overwrites_diverged_branches": false, "external_authorization_classification_label": null, "packages_enabled": true, "service_desk_enabled": false, "service_desk_address": null, "autoclose_referenced_issues": true, "suggestion_commit_message": null, "statistics": { "commit_count": 12, "storage_size": 2066080, "repository_size": 2066080, "lfs_objects_size": 0, "job_artifacts_size": 0 }, "_links": { "self": "http://example.com/api/v4/projects", "issues": "http://example.com/api/v4/projects/1/issues", "merge_requests": "http://example.com/api/v4/projects/1/merge_requests", "repo_branches": "http://example.com/api/v4/projects/1/repository_branches", "labels": "http://example.com/api/v4/projects/1/labels", "events": "http://example.com/api/v4/projects/1/events", "members": "http://example.com/api/v4/projects/1/members" } } ]
```
## Get single project[](#get-single-project "Permalink")
獲取一個特定的項目. 如果可以公開訪問該項目,則無需身份驗證即可訪問該端點.
```
GET /projects/:id
```
| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 項目的 ID 或[URL 編碼的路徑](README.html#namespaced-path-encoding) |
| `statistics` | boolean | no | 包括項目統計 |
| `license` | boolean | no | 包括項目許可證數據 |
| `with_custom_attributes` | boolean | no | 在響應中包括[自定義屬性](custom_attributes.html) (僅管理員) |
```
{ "id": 3, "description": null, "default_branch": "master", "visibility": "private", "ssh_url_to_repo": "git@example.com:diaspora/diaspora-project-site.git", "http_url_to_repo": "http://example.com/diaspora/diaspora-project-site.git", "web_url": "http://example.com/diaspora/diaspora-project-site", "readme_url": "http://example.com/diaspora/diaspora-project-site/blob/master/README.md", "tag_list": [ "example", "disapora project" ], "owner": { "id": 3, "name": "Diaspora", "created_at": "2013-09-30T13:46:02Z" }, "name": "Diaspora Project Site", "name_with_namespace": "Diaspora / Diaspora Project Site", "path": "diaspora-project-site", "path_with_namespace": "diaspora/diaspora-project-site", "issues_enabled": true, "open_issues_count": 1, "merge_requests_enabled": true, "jobs_enabled": true, "wiki_enabled": true, "snippets_enabled": false, "can_create_merge_request_in": true, "resolve_outdated_diff_discussions": false, "container_registry_enabled": false, "container_expiration_policy": { "cadence": "7d", "enabled": false, "keep_n": null, "older_than": null, "name_regex": null, // to be deprecated in GitLab 13.0 in favor of `name_regex_delete` "name_regex_delete": null, "name_regex_keep": null, "next_run_at": "2020-01-07T21:42:58.658Z" }, "created_at": "2013-09-30T13:46:02Z", "last_activity_at": "2013-09-30T13:46:02Z", "creator_id": 3, "namespace": { "id": 3, "name": "Diaspora", "path": "diaspora", "kind": "group", "full_path": "diaspora", "avatar_url": "http://localhost:3000/uploads/group/avatar/3/foo.jpg", "web_url": "http://localhost:3000/groups/diaspora" }, "import_status": "none", "import_error": null, "permissions": { "project_access": { "access_level": 10, "notification_level": 3 }, "group_access": { "access_level": 50, "notification_level": 3 } }, "archived": false, "avatar_url": "http://example.com/uploads/project/avatar/3/uploads/avatar.png", "license_url": "http://example.com/diaspora/diaspora-client/blob/master/LICENSE", "license": { "key": "lgpl-3.0", "name": "GNU Lesser General Public License v3.0", "nickname": "GNU LGPLv3", "html_url": "http://choosealicense.com/licenses/lgpl-3.0/", "source_url": "http://www.gnu.org/licenses/lgpl-3.0.txt" }, "shared_runners_enabled": true, "forks_count": 0, "star_count": 0, "runners_token": "b8bc4a7a29eb76ea83cf79e4908c2b", "ci_default_git_depth": 50, "public_jobs": true, "shared_with_groups": [ { "group_id": 4, "group_name": "Twitter", "group_full_path": "twitter", "group_access_level": 30 }, { "group_id": 3, "group_name": "Gitlab Org", "group_full_path": "gitlab-org", "group_access_level": 10 } ], "repository_storage": "default", "only_allow_merge_if_pipeline_succeeds": false, "allow_merge_on_skipped_pipeline": false, "only_allow_merge_if_all_discussions_are_resolved": false, "remove_source_branch_after_merge": false, "printing_merge_requests_link_enabled": true, "request_access_enabled": false, "merge_method": "merge", "auto_devops_enabled": true, "auto_devops_deploy_strategy": "continuous", "repository_storage": "default", "approvals_before_merge": 0, "mirror": false, "mirror_user_id": 45, "mirror_trigger_builds": false, "only_mirror_protected_branches": false, "mirror_overwrites_diverged_branches": false, "external_authorization_classification_label": null, "packages_enabled": true, "service_desk_enabled": false, "service_desk_address": null, "autoclose_referenced_issues": true, "suggestion_commit_message": null, "marked_for_deletion_at": "2020-04-03", // Deprecated and will be removed in API v5 in favor of marked_for_deletion_on "marked_for_deletion_on": "2020-04-03", "compliance_frameworks": [ "sox" ], "statistics": { "commit_count": 37, "storage_size": 1038090, "repository_size": 1038090, "wiki_size" : 0, "lfs_objects_size": 0, "job_artifacts_size": 0, "packages_size": 0 }, "_links": { "self": "http://example.com/api/v4/projects", "issues": "http://example.com/api/v4/projects/1/issues", "merge_requests": "http://example.com/api/v4/projects/1/merge_requests", "repo_branches": "http://example.com/api/v4/projects/1/repository_branches", "labels": "http://example.com/api/v4/projects/1/labels", "events": "http://example.com/api/v4/projects/1/events", "members": "http://example.com/api/v4/projects/1/members" } }
```
在 GitLab 用戶[入門,青銅或更高](https://about.gitlab.com/pricing/)還會看到`approvals_before_merge`參數:
```
{ "id": 3, "description": null, "approvals_before_merge": 0, ... }
```
**注意** :GitLab 11.11 中[引入](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/27427)了`namespace`上的`web_url`和`avatar_url`屬性.
如果項目是 fork,并且您提供了有效的令牌進行身份驗證,則`forked_from_project`字段將出現在響應中.
```
{ "id":3, ... "forked_from_project":{ "id":13083, "description":"GitLab Community Edition", "name":"GitLab Community Edition", "name_with_namespace":"GitLab.org / GitLab Community Edition", "path":"gitlab-foss", "path_with_namespace":"gitlab-org/gitlab-foss", "created_at":"2013-09-26T06:02:36.000Z", "default_branch":"master", "tag_list":[], "ssh_url_to_repo":"git@gitlab.com:gitlab-org/gitlab-foss.git", "http_url_to_repo":"https://gitlab.com/gitlab-org/gitlab-foss.git", "web_url":"https://gitlab.com/gitlab-org/gitlab-foss", "avatar_url":"https://assets.gitlab-static.net/uploads/-/system/project/avatar/13083/logo-extra-whitespace.png", "license_url": "https://gitlab.com/gitlab-org/gitlab/blob/master/LICENSE", "license": { "key": "mit", "name": "MIT License", "nickname": null, "html_url": "http://choosealicense.com/licenses/mit/", "source_url": "https://opensource.org/licenses/MIT", }, "star_count":3812, "forks_count":3561, "last_activity_at":"2018-01-02T11:40:26.570Z", "namespace": { "id": 72, "name": "GitLab.org", "path": "gitlab-org", "kind": "group", "full_path": "gitlab-org", "parent_id": null } } ... }
```
## Get project users[](#get-project-users "Permalink")
獲取項目的用戶列表.
```
GET /projects/:id/users
```
| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 項目的 ID 或[URL 編碼的路徑](README.html#namespaced-path-encoding) |
| `search` | string | no | 搜索特定用戶 |
| `skip_users` | 整數數組 | no | 篩選出具有指定 ID 的用戶 |
```
[ { "id": 1, "username": "john_smith", "name": "John Smith", "state": "active", "avatar_url": "http://localhost:3000/uploads/user/avatar/1/cd8.jpeg", "web_url": "http://localhost:3000/john_smith" }, { "id": 2, "username": "jack_smith", "name": "Jack Smith", "state": "blocked", "avatar_url": "http://gravatar.com/../e32131cd8.jpeg", "web_url": "http://localhost:3000/jack_smith" } ]
```
## Get project events[](#get-project-events "Permalink")
請參考[Events API 文檔](events.html#list-a-projects-visible-events) .
## Create project[](#create-project "Permalink")
創建一個經過身份驗證的用戶擁有的新項目.
```
POST /projects
```
| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | 是,如果未提供路徑 | 新項目的名稱. 如果未提供,則等于路徑. |
| `path` | string | 是,如果未提供名稱 | 新項目的存儲庫名稱. 如果未提供,則根據名稱生成(生成的小寫字母加短劃線). |
| `namespace_id` | integer | no | 新項目的命名空間(默認為當前用戶的命名空間) |
| `default_branch` | string | no | `master`默認 |
| `description` | string | no | 簡短的項目說明 |
| `issues_enabled` | boolean | no | (不建議使用)為此項目啟用問題. 改用`issues_access_level` |
| `merge_requests_enabled` | boolean | no | (不建議使用)為此項目啟用合并請求. 改用`merge_requests_access_level` |
| `jobs_enabled` | boolean | no | (不建議使用)為此項目啟用作業. 改用`builds_access_level` |
| `wiki_enabled` | boolean | no | (已棄用)為此項目啟用 Wiki. 改用`wiki_access_level` |
| `snippets_enabled` | boolean | no | (不建議使用)為此項目啟用摘要. 請改用`snippets_access_level` |
| `issues_access_level` | string | no | `disabled` , `private`或`enabled` |
| `repository_access_level` | string | no | `disabled` , `private`或`enabled` |
| `merge_requests_access_level` | string | no | `disabled` , `private`或`enabled` |
| `forking_access_level` | string | no | `disabled` , `private`或`enabled` |
| `builds_access_level` | string | no | `disabled` , `private`或`enabled` |
| `wiki_access_level` | string | no | `disabled` , `private`或`enabled` |
| `snippets_access_level` | string | no | `disabled` , `private`或`enabled` |
| `pages_access_level` | string | no | `disabled` , `private` , `enabled`或`public` |
| `emails_disabled` | boolean | no | 禁用電子郵件通知 |
| `show_default_award_emojis` | boolean | no | 顯示默認的獎勵表情符號 |
| `resolve_outdated_diff_discussions` | boolean | no | 自動解決合并請求差異討論(通過推送更改) |
| `container_registry_enabled` | boolean | no | 為該項目啟用容器注冊表 |
| `container_expiration_policy_attributes` | hash | no | 更新此項目的圖像過期策略. 接受: `cadence` (字符串), `keep_n` (字符串), `older_than` (字符串), `name_regex` (字符串), `name_regex_delete` (字符串), `name_regex_keep` (字符串), `enabled` (布爾值) |
| `shared_runners_enabled` | boolean | no | 為此項目啟用共享跑步者 |
| `visibility` | string | no | See [project visibility level](#project-visibility-level) |
| `import_url` | string | no | 從中導入存儲庫的 URL |
| `public_builds` | boolean | no | 如果為`true` ,則非項目成員可以查看作業 |
| `only_allow_merge_if_pipeline_succeeds` | boolean | no | 設置是否只能將合并請求與成功的作業合并 |
| `allow_merge_on_skipped_pipeline` | boolean | no | 設置是否可以將合并請求與跳過的作業合并 |
| `only_allow_merge_if_all_discussions_are_resolved` | boolean | no | 設置是否僅在所有討論都解決后才能合并合并請求 |
| `merge_method` | string | no | 設置使用的[合并方法](#project-merge-method) |
| `autoclose_referenced_issues` | boolean | no | 設置是否自動關閉默認分支上的引用問題 |
| `remove_source_branch_after_merge` | boolean | no | 默認情況下,為所有新合并請求啟用" `Delete source branch`選項 |
| `lfs_enabled` | boolean | no | 啟用 LFS |
| `request_access_enabled` | boolean | no | 允許用戶請求成員訪問 |
| `tag_list` | array | no | 項目標簽列表; 放置標簽數組,這些標簽應最終分配給項目 |
| `avatar` | mixed | no | 項目頭像的圖像文件 |
| `printing_merge_request_link_enabled` | boolean | no | 從命令行推送時顯示創建/查看合并請求的鏈接 |
| `build_git_strategy` | string | no | Git 策略. 默認為`fetch` |
| `build_timeout` | integer | no | 作業可以運行的最長時間(以分鐘為單位)(以秒為單位) |
| `auto_cancel_pending_pipelines` | string | no | 自動取消掛起的管道(注意:這不是布爾值,但已啟用/禁用 |
| `build_coverage_regex` | string | no | 測試覆蓋率解析 |
| `ci_config_path` | string | no | CI 配置文件的路徑 |
| `auto_devops_enabled` | boolean | no | 為該項目啟用 Auto DevOps |
| `auto_devops_deploy_strategy` | string | no | 自動部署策略( `continuous` , `manual`或`timed_incremental` ) |
| `repository_storage` | string | no | 存儲庫位于哪個存儲分片上. 僅適用于管理員 |
| `approvals_before_merge` | integer | no | 默認情況下,應有多少個批準者批準合并請求 |
| `external_authorization_classification_label` | string | no | 項目的分類標簽 |
| `mirror` | boolean | no | 在項目中啟用拉鏡像 |
| `mirror_trigger_builds` | boolean | no | 拉鏡像觸發器構建 |
| `initialize_with_readme` | boolean | no | 默認為`false` |
| `template_name` | string | no | 不使用`use_custom_template` ,為[內置項目模板的名稱](../gitlab-basics/create-project.html#built-in-templates) . 與`use_custom_template`使用時,自定義項目模板的名稱 |
| `template_project_id` | integer | no | 與`use_custom_template`使用時,是自定義項目模板的項目 ID. 這比使用`template_name`更可取,因為`template_name`可能含糊. |
| `use_custom_template` | boolean | no | 使用自定義[實例](../user/admin_area/custom_project_templates.html)或[組](../user/group/custom_project_templates.html) (帶有`group_with_project_templates_id` )項目模板 |
| `group_with_project_templates_id` | integer | no | 對于組級別的自定義模板,指定所有自定義項目模板所源自的組的 ID. 將實例級模板留空. 要求`use_custom_template`為 true |
| `packages_enabled` | boolean | no | 啟用或禁用軟件包存儲庫功能 |
**注意:**如果您的 HTTP 存儲庫不可公開訪問,請將身份驗證信息添加到 URL: `https://username:password@gitlab.company.com/group/project.git` ,其中`password`是啟用了`api`范圍的公共訪問密鑰.
## Create project for user[](#create-project-for-user "Permalink")
創建一個由指定用戶擁有的新項目. 僅適用于管理員.
```
POST /projects/user/:user_id
```
| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `user_id` | integer | yes | 項目所有者的用戶標識 |
| `name` | string | yes | 新項目的名稱 |
| `path` | string | no | 新項目的自定義存儲庫名稱. 默認情況下根據名稱生成 |
| `namespace_id` | integer | no | Namespace for the new project (defaults to the current user’s namespace) |
| `description` | string | no | 簡短的項目說明 |
| `issues_enabled` | boolean | no | (不建議使用)為此項目啟用問題. 改用`issues_access_level` |
| `merge_requests_enabled` | boolean | no | (不建議使用)為此項目啟用合并請求. 改用`merge_requests_access_level` |
| `jobs_enabled` | boolean | no | (不建議使用)為此項目啟用作業. 改用`builds_access_level` |
| `wiki_enabled` | boolean | no | (已棄用)為此項目啟用 Wiki. 改用`wiki_access_level` |
| `snippets_enabled` | boolean | no | (不建議使用)為此項目啟用摘要. 請改用`snippets_access_level` |
| `issues_access_level` | string | no | `disabled` , `private`或`enabled` |
| `repository_access_level` | string | no | `disabled` , `private`或`enabled` |
| `merge_requests_access_level` | string | no | `disabled` , `private`或`enabled` |
| `forking_access_level` | string | no | `disabled` , `private`或`enabled` |
| `builds_access_level` | string | no | `disabled` , `private`或`enabled` |
| `wiki_access_level` | string | no | `disabled` , `private`或`enabled` |
| `snippets_access_level` | string | no | `disabled` , `private`或`enabled` |
| `pages_access_level` | string | no | `disabled` , `private` , `enabled`或`public` |
| `emails_disabled` | boolean | no | 禁用電子郵件通知 |
| `show_default_award_emojis` | boolean | no | 顯示默認的獎勵表情符號 |
| `resolve_outdated_diff_discussions` | boolean | no | 自動解決合并請求差異討論(通過推送更改) |
| `container_registry_enabled` | boolean | no | 為該項目啟用容器注冊表 |
| `shared_runners_enabled` | boolean | no | 為此項目啟用共享跑步者 |
| `visibility` | string | no | See [project visibility level](#project-visibility-level) |
| `import_url` | string | no | 從中導入存儲庫的 URL |
| `public_builds` | boolean | no | 如果為`true` ,則非項目成員可以查看作業 |
| `only_allow_merge_if_pipeline_succeeds` | boolean | no | 設置是否只能將合并請求與成功的作業合并 |
| `allow_merge_on_skipped_pipeline` | boolean | no | 設置是否可以將合并請求與跳過的作業合并 |
| `only_allow_merge_if_all_discussions_are_resolved` | boolean | no | 設置是否僅在所有討論都解決后才能合并合并請求 |
| `merge_method` | string | no | 設置使用的[合并方法](#project-merge-method) |
| `autoclose_referenced_issues` | boolean | no | 設置是否自動關閉默認分支上的引用問題 |
| `suggestion_commit_message` | string | no | 用于應用合并請求建議的提交消息 |
| `remove_source_branch_after_merge` | boolean | no | 默認情況下,為所有新合并請求啟用" `Delete source branch`選項 |
| `lfs_enabled` | boolean | no | 啟用 LFS |
| `request_access_enabled` | boolean | no | 允許用戶請求成員訪問 |
| `tag_list` | array | no | 項目標簽列表; 放置標簽數組,這些標簽應最終分配給項目 |
| `avatar` | mixed | no | 項目頭像的圖像文件 |
| `printing_merge_request_link_enabled` | boolean | no | 從命令行推送時顯示創建/查看合并請求的鏈接 |
| `build_git_strategy` | string | no | Git 策略. 默認為`fetch` |
| `build_timeout` | integer | no | 作業可以運行的最長時間(以分鐘為單位)(以秒為單位) |
| `auto_cancel_pending_pipelines` | string | no | 自動取消掛起的管道(注意:這不是布爾值,但已啟用/禁用 |
| `build_coverage_regex` | string | no | 測試覆蓋率解析 |
| `ci_config_path` | string | no | CI 配置文件的路徑 |
| `auto_devops_enabled` | boolean | no | 為該項目啟用 Auto DevOps |
| `auto_devops_deploy_strategy` | string | no | 自動部署策略( `continuous` , `manual`或`timed_incremental` ) |
| `repository_storage` | string | no | 存儲庫位于哪個存儲分片上. 僅適用于管理員 |
| `approvals_before_merge` | integer | no | 默認情況下,應有多少個批準者批準合并請求 |
| `external_authorization_classification_label` | string | no | 項目的分類標簽 |
| `mirror` | boolean | no | 在項目中啟用拉鏡像 |
| `mirror_trigger_builds` | boolean | no | 拉鏡像觸發器構建 |
| `initialize_with_readme` | boolean | no | 默認為`false` |
| `template_name` | string | no | 不使用`use_custom_template` ,為[內置項目模板的名稱](../gitlab-basics/create-project.html#built-in-templates) . 與`use_custom_template`使用時,自定義項目模板的名稱 |
| `use_custom_template` | boolean | no | Use either custom [instance](../user/admin_area/custom_project_templates.html) or [group](../user/group/custom_project_templates.html) (with `group_with_project_templates_id`) project template |
| `group_with_project_templates_id` | integer | no | 對于組級別的自定義模板,指定所有自定義項目模板所源自的組的 ID. 將實例級模板留空. 要求`use_custom_template`為 true |
| `packages_enabled` | boolean | no | 啟用或禁用軟件包存儲庫功能 |
**注意:**如果您的 HTTP 存儲庫不可公開訪問,請將身份驗證信息添加到 URL: `https://username:password@gitlab.company.com/group/project.git` ,其中`password`是啟用了`api`范圍的公共訪問密鑰.
## Edit project[](#edit-project "Permalink")
更新現有項目.
```
PUT /projects/:id
```
| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 項目的 ID 或[URL 編碼的路徑](README.html#namespaced-path-encoding) |
| `name` | string | no | 項目名稱 |
| `path` | string | no | 項目的自定義存儲庫名稱. 默認情況下根據名稱生成 |
| `default_branch` | string | no | `master`默認 |
| `description` | string | no | 簡短的項目說明 |
| `issues_enabled` | boolean | no | (不建議使用)為此項目啟用問題. 改用`issues_access_level` |
| `merge_requests_enabled` | boolean | no | (不建議使用)為此項目啟用合并請求. 改用`merge_requests_access_level` |
| `jobs_enabled` | boolean | no | (不建議使用)為此項目啟用作業. 改用`builds_access_level` |
| `wiki_enabled` | boolean | no | (已棄用)為此項目啟用 Wiki. 改用`wiki_access_level` |
| `snippets_enabled` | boolean | no | (不建議使用)為此項目啟用摘要. 請改用`snippets_access_level` |
| `issues_access_level` | string | no | `disabled` , `private`或`enabled` |
| `repository_access_level` | string | no | `disabled` , `private`或`enabled` |
| `merge_requests_access_level` | string | no | `disabled` , `private`或`enabled` |
| `forking_access_level` | string | no | `disabled` , `private`或`enabled` |
| `builds_access_level` | string | no | `disabled` , `private`或`enabled` |
| `wiki_access_level` | string | no | `disabled` , `private`或`enabled` |
| `snippets_access_level` | string | no | `disabled` , `private`或`enabled` |
| `pages_access_level` | string | no | `disabled` , `private` , `enabled`或`public` |
| `emails_disabled` | boolean | no | 禁用電子郵件通知 |
| `show_default_award_emojis` | boolean | no | 顯示默認的獎勵表情符號 |
| `resolve_outdated_diff_discussions` | boolean | no | 自動解決合并請求差異討論(通過推送更改) |
| `container_registry_enabled` | boolean | no | 為該項目啟用容器注冊表 |
| `container_expiration_policy_attributes` | hash | no | 更新此項目的圖像過期策略. 接受: `cadence` (字符串), `keep_n` (字符串), `older_than` (字符串), `name_regex` (字符串), `name_regex_delete` (字符串), `name_regex_keep` (字符串), `enabled` (布爾值) |
| `shared_runners_enabled` | boolean | no | 為此項目啟用共享跑步者 |
| `visibility` | string | no | See [project visibility level](#project-visibility-level) |
| `import_url` | string | no | 從中導入存儲庫的 URL |
| `public_builds` | boolean | no | 如果為`true` ,則非項目成員可以查看作業 |
| `only_allow_merge_if_pipeline_succeeds` | boolean | no | 設置是否只能將合并請求與成功的作業合并 |
| `allow_merge_on_skipped_pipeline` | boolean | no | 設置是否可以將合并請求與跳過的作業合并 |
| `only_allow_merge_if_all_discussions_are_resolved` | boolean | no | 設置是否僅在所有討論都解決后才能合并合并請求 |
| `merge_method` | string | no | 設置使用的[合并方法](#project-merge-method) |
| `autoclose_referenced_issues` | boolean | no | 設置是否自動關閉默認分支上的引用問題 |
| `suggestion_commit_message` | string | no | 用于應用合并請求建議的提交消息 |
| `remove_source_branch_after_merge` | boolean | no | 默認情況下,為所有新合并請求啟用" `Delete source branch`選項 |
| `lfs_enabled` | boolean | no | 啟用 LFS |
| `request_access_enabled` | boolean | no | 允許用戶請求成員訪問 |
| `tag_list` | array | no | 項目標簽列表; 放置標簽數組,這些標簽應最終分配給項目 |
| `avatar` | mixed | no | 項目頭像的圖像文件 |
| `build_git_strategy` | string | no | Git 策略. 默認為`fetch` |
| `build_timeout` | integer | no | 作業可以運行的最長時間(以分鐘為單位)(以秒為單位) |
| `auto_cancel_pending_pipelines` | string | no | 自動取消掛起的管道(注意:這不是布爾值,但已啟用/禁用 |
| `build_coverage_regex` | string | no | 測試覆蓋率解析 |
| `ci_config_path` | string | no | CI 配置文件的路徑 |
| `ci_default_git_depth` | integer | no | [淺克隆的](../ci/pipelines/settings.html#git-shallow-clone)默認修訂版本數 |
| `auto_devops_enabled` | boolean | no | 為該項目啟用 Auto DevOps |
| `auto_devops_deploy_strategy` | string | no | 自動部署策略( `continuous` , `manual`或`timed_incremental` ) |
| `repository_storage` | string | no | 存儲庫位于哪個存儲分片上. 僅適用于管理員 |
| `approvals_before_merge` | integer | no | How many approvers should approve merge request by default |
| `external_authorization_classification_label` | string | no | 項目的分類標簽 |
| `mirror` | boolean | no | 在項目中啟用拉鏡像 |
| `mirror_user_id` | integer | no | 用戶負責拉鏡事件周圍的所有活動. 只能由管理員設置. |
| `mirror_trigger_builds` | boolean | no | 拉鏡像觸發器構建 |
| `only_mirror_protected_branches` | boolean | no | 僅鏡像保護的分支 |
| `mirror_overwrites_diverged_branches` | boolean | no | 拉鏡將覆蓋分散的分支 |
| `packages_enabled` | boolean | no | 啟用或禁用軟件包存儲庫功能 |
| `service_desk_enabled` | boolean | no | 啟用或禁用服務臺功能 |
**注意:**如果您的 HTTP 存儲庫不可公開訪問,請將身份驗證信息添加到 URL: `https://username:password@gitlab.company.com/group/project.git` ,其中`password`是啟用了`api`范圍的公共訪問密鑰.
## Fork project[](#fork-project "Permalink")
將項目派生到已認證用戶或提供的用戶的用戶名稱空間中.
項目的分叉操作是異步的,并在后臺作業中完成. 該請求將立即返回. 要確定項目的分支是否已完成,請查詢`import_status`以獲取新項目.
```
POST /projects/:id/fork
```
| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 項目的 ID 或[URL 編碼的路徑](README.html#namespaced-path-encoding) |
| `namespace` | integer/string | no | (不建議使用)項目將分叉到的名稱空間的 ID 或路徑 |
| `namespace_id` | integer | no | 項目將分叉到的名稱空間的 ID |
| `namespace_path` | string | no | 項目將分叉到的名稱空間的路徑 |
| `path` | string | no | 分叉后將分配給結果項目的路徑 |
| `name` | string | no | 分叉后將分配給結果項目的名稱 |
## List Forks of a project[](#list-forks-of-a-project "Permalink")
**注意:**此功能是在 GitLab 10.1 中引入的.
列出呼叫用戶可訪問的與指定項目具有已建立的分叉關系的項目
```
GET /projects/:id/forks
```
| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 項目的 ID 或[URL 編碼的路徑](README.html#namespaced-path-encoding) |
| `archived` | boolean | no | 受存檔狀態限制 |
| `visibility` | string | no | 受`public` , `internal`或`private`可見性的限制 |
| `order_by` | string | no | 返回按`id` , `name` , `path` , `created_at` , `updated_at`或`last_activity_at`字段排序的項目. 默認為`created_at` |
| `sort` | string | no | 返回按`asc`或`desc`順序排序的項目. 默認為`desc` |
| `search` | string | no | 返回符合搜索條件的項目列表 |
| `simple` | boolean | no | 僅返回每個項目的有限字段. 這是沒有身份驗證的無操作操作,因為這樣*只會*返回簡單的字段. |
| `owned` | boolean | no | 受當前用戶明確擁有的項目限制 |
| `membership` | boolean | no | 受當前用戶是其成員的項目的限制 |
| `starred` | boolean | no | 受當前用戶加注星標的項目限制 |
| `statistics` | boolean | no | 包括項目統計 |
| `with_custom_attributes` | boolean | no | 在響應中包括[自定義屬性](custom_attributes.html) (僅管理員) |
| `with_issues_enabled` | boolean | no | 受啟用的問題限制功能 |
| `with_merge_requests_enabled` | boolean | no | 通過啟用的合并請求限制功能 |
| `min_access_level` | integer | no | 受當前用戶的最小[訪問權限](members.html)限制 |
```
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/forks"
```
響應示例:
```
[ { "id": 3, "description": null, "default_branch": "master", "visibility": "internal", "ssh_url_to_repo": "git@example.com:diaspora/diaspora-project-site.git", "http_url_to_repo": "http://example.com/diaspora/diaspora-project-site.git", "web_url": "http://example.com/diaspora/diaspora-project-site", "readme_url": "http://example.com/diaspora/diaspora-project-site/blob/master/README.md", "tag_list": [ "example", "disapora project" ], "name": "Diaspora Project Site", "name_with_namespace": "Diaspora / Diaspora Project Site", "path": "diaspora-project-site", "path_with_namespace": "diaspora/diaspora-project-site", "issues_enabled": true, "open_issues_count": 1, "merge_requests_enabled": true, "jobs_enabled": true, "wiki_enabled": true, "snippets_enabled": false, "can_create_merge_request_in": true, "resolve_outdated_diff_discussions": false, "container_registry_enabled": false, "created_at": "2013-09-30T13:46:02Z", "last_activity_at": "2013-09-30T13:46:02Z", "creator_id": 3, "namespace": { "id": 3, "name": "Diaspora", "path": "diaspora", "kind": "group", "full_path": "diaspora" }, "import_status": "none", "archived": true, "avatar_url": "http://example.com/uploads/project/avatar/3/uploads/avatar.png", "shared_runners_enabled": true, "forks_count": 0, "star_count": 1, "public_jobs": true, "shared_with_groups": [], "only_allow_merge_if_pipeline_succeeds": false, "allow_merge_on_skipped_pipeline": false, "only_allow_merge_if_all_discussions_are_resolved": false, "remove_source_branch_after_merge": false, "request_access_enabled": false, "merge_method": "merge", "autoclose_referenced_issues": true, "suggestion_commit_message": null, "_links": { "self": "http://example.com/api/v4/projects", "issues": "http://example.com/api/v4/projects/1/issues", "merge_requests": "http://example.com/api/v4/projects/1/merge_requests", "repo_branches": "http://example.com/api/v4/projects/1/repository_branches", "labels": "http://example.com/api/v4/projects/1/labels", "events": "http://example.com/api/v4/projects/1/events", "members": "http://example.com/api/v4/projects/1/members" } } ]
```
## Star a project[](#star-a-project "Permalink")
明星給定的項目. 如果項目已加星標,則返回狀態碼`304` .
```
POST /projects/:id/star
```
| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 項目的 ID 或[URL 編碼的路徑](README.html#namespaced-path-encoding) |
```
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/star"
```
響應示例:
```
{ "id": 3, "description": null, "default_branch": "master", "visibility": "internal", "ssh_url_to_repo": "git@example.com:diaspora/diaspora-project-site.git", "http_url_to_repo": "http://example.com/diaspora/diaspora-project-site.git", "web_url": "http://example.com/diaspora/diaspora-project-site", "readme_url": "http://example.com/diaspora/diaspora-project-site/blob/master/README.md", "tag_list": [ "example", "disapora project" ], "name": "Diaspora Project Site", "name_with_namespace": "Diaspora / Diaspora Project Site", "path": "diaspora-project-site", "path_with_namespace": "diaspora/diaspora-project-site", "issues_enabled": true, "open_issues_count": 1, "merge_requests_enabled": true, "jobs_enabled": true, "wiki_enabled": true, "snippets_enabled": false, "can_create_merge_request_in": true, "resolve_outdated_diff_discussions": false, "container_registry_enabled": false, "created_at": "2013-09-30T13:46:02Z", "last_activity_at": "2013-09-30T13:46:02Z", "creator_id": 3, "namespace": { "id": 3, "name": "Diaspora", "path": "diaspora", "kind": "group", "full_path": "diaspora" }, "import_status": "none", "archived": true, "avatar_url": "http://example.com/uploads/project/avatar/3/uploads/avatar.png", "license_url": "http://example.com/diaspora/diaspora-client/blob/master/LICENSE", "license": { "key": "lgpl-3.0", "name": "GNU Lesser General Public License v3.0", "nickname": "GNU LGPLv3", "html_url": "http://choosealicense.com/licenses/lgpl-3.0/", "source_url": "http://www.gnu.org/licenses/lgpl-3.0.txt" }, "shared_runners_enabled": true, "forks_count": 0, "star_count": 1, "public_jobs": true, "shared_with_groups": [], "only_allow_merge_if_pipeline_succeeds": false, "allow_merge_on_skipped_pipeline": false, "only_allow_merge_if_all_discussions_are_resolved": false, "remove_source_branch_after_merge": false, "request_access_enabled": false, "merge_method": "merge", "autoclose_referenced_issues": true, "suggestion_commit_message": null, "_links": { "self": "http://example.com/api/v4/projects", "issues": "http://example.com/api/v4/projects/1/issues", "merge_requests": "http://example.com/api/v4/projects/1/merge_requests", "repo_branches": "http://example.com/api/v4/projects/1/repository_branches", "labels": "http://example.com/api/v4/projects/1/labels", "events": "http://example.com/api/v4/projects/1/events", "members": "http://example.com/api/v4/projects/1/members" } }
```
## Unstar a project[](#unstar-a-project "Permalink")
取消給定項目的星標. 如果項目未加星標,則返回狀態碼`304` .
```
POST /projects/:id/unstar
```
| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 項目的 ID 或[URL 編碼的路徑](README.html#namespaced-path-encoding) |
```
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/unstar"
```
響應示例:
```
{ "id": 3, "description": null, "default_branch": "master", "visibility": "internal", "ssh_url_to_repo": "git@example.com:diaspora/diaspora-project-site.git", "http_url_to_repo": "http://example.com/diaspora/diaspora-project-site.git", "web_url": "http://example.com/diaspora/diaspora-project-site", "readme_url": "http://example.com/diaspora/diaspora-project-site/blob/master/README.md", "tag_list": [ "example", "disapora project" ], "name": "Diaspora Project Site", "name_with_namespace": "Diaspora / Diaspora Project Site", "path": "diaspora-project-site", "path_with_namespace": "diaspora/diaspora-project-site", "issues_enabled": true, "open_issues_count": 1, "merge_requests_enabled": true, "jobs_enabled": true, "wiki_enabled": true, "snippets_enabled": false, "can_create_merge_request_in": true, "resolve_outdated_diff_discussions": false, "container_registry_enabled": false, "created_at": "2013-09-30T13:46:02Z", "last_activity_at": "2013-09-30T13:46:02Z", "creator_id": 3, "namespace": { "id": 3, "name": "Diaspora", "path": "diaspora", "kind": "group", "full_path": "diaspora" }, "import_status": "none", "archived": true, "avatar_url": "http://example.com/uploads/project/avatar/3/uploads/avatar.png", "license_url": "http://example.com/diaspora/diaspora-client/blob/master/LICENSE", "license": { "key": "lgpl-3.0", "name": "GNU Lesser General Public License v3.0", "nickname": "GNU LGPLv3", "html_url": "http://choosealicense.com/licenses/lgpl-3.0/", "source_url": "http://www.gnu.org/licenses/lgpl-3.0.txt" }, "shared_runners_enabled": true, "forks_count": 0, "star_count": 0, "public_jobs": true, "shared_with_groups": [], "only_allow_merge_if_pipeline_succeeds": false, "allow_merge_on_skipped_pipeline": false, "only_allow_merge_if_all_discussions_are_resolved": false, "remove_source_branch_after_merge": false, "request_access_enabled": false, "merge_method": "merge", "autoclose_referenced_issues": true, "suggestion_commit_message": null, "_links": { "self": "http://example.com/api/v4/projects", "issues": "http://example.com/api/v4/projects/1/issues", "merge_requests": "http://example.com/api/v4/projects/1/merge_requests", "repo_branches": "http://example.com/api/v4/projects/1/repository_branches", "labels": "http://example.com/api/v4/projects/1/labels", "events": "http://example.com/api/v4/projects/1/events", "members": "http://example.com/api/v4/projects/1/members" } }
```
## List Starrers of a project[](#list-starrers-of-a-project "Permalink")
列出為指定項目加注星標的用戶.
```
GET /projects/:id/starrers
```
| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 項目的 ID 或[URL 編碼的路徑](README.html#namespaced-path-encoding) |
| `search` | string | no | 搜索特定用戶. |
```
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/starrers"
```
響應示例:
```
[ { "starred_since": "2019-01-28T14:47:30.642Z", "user": { "id": 1, "username": "jane_smith", "name": "Jane Smith", "state": "active", "avatar_url": "http://localhost:3000/uploads/user/avatar/1/cd8.jpeg", "web_url": "http://localhost:3000/jane_smith" } }, "starred_since": "2018-01-02T11:40:26.570Z", "user": { "id": 2, "username": "janine_smith", "name": "Janine Smith", "state": "blocked", "avatar_url": "http://gravatar.com/../e32131cd8.jpeg", "web_url": "http://localhost:3000/janine_smith" } ]
```
## Languages[](#languages "Permalink")
獲取具有百分比值的項目中使用的語言.
```
GET /projects/:id/languages
```
| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 項目的 ID 或[URL 編碼的路徑](README.html#namespaced-path-encoding) |
```
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/languages"
```
響應示例:
```
{ "Ruby": 66.69, "JavaScript": 22.98, "HTML": 7.91, "CoffeeScript": 2.42 }
```
## Archive a project[](#archive-a-project "Permalink")
如果用戶是該項目的管理員或項目所有者,則歸檔該項目. 此操作是冪等的,因此歸檔已歸檔的項目不會更改該項目.
```
POST /projects/:id/archive
```
| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 項目的 ID 或[URL 編碼的路徑](README.html#namespaced-path-encoding) |
```
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/archive"
```
響應示例:
```
{ "id": 3, "description": null, "default_branch": "master", "visibility": "private", "ssh_url_to_repo": "git@example.com:diaspora/diaspora-project-site.git", "http_url_to_repo": "http://example.com/diaspora/diaspora-project-site.git", "web_url": "http://example.com/diaspora/diaspora-project-site", "readme_url": "http://example.com/diaspora/diaspora-project-site/blob/master/README.md", "tag_list": [ "example", "disapora project" ], "owner": { "id": 3, "name": "Diaspora", "created_at": "2013-09-30T13:46:02Z" }, "name": "Diaspora Project Site", "name_with_namespace": "Diaspora / Diaspora Project Site", "path": "diaspora-project-site", "path_with_namespace": "diaspora/diaspora-project-site", "issues_enabled": true, "open_issues_count": 1, "merge_requests_enabled": true, "jobs_enabled": true, "wiki_enabled": true, "snippets_enabled": false, "can_create_merge_request_in": true, "resolve_outdated_diff_discussions": false, "container_registry_enabled": false, "created_at": "2013-09-30T13:46:02Z", "last_activity_at": "2013-09-30T13:46:02Z", "creator_id": 3, "namespace": { "id": 3, "name": "Diaspora", "path": "diaspora", "kind": "group", "full_path": "diaspora" }, "import_status": "none", "import_error": null, "permissions": { "project_access": { "access_level": 10, "notification_level": 3 }, "group_access": { "access_level": 50, "notification_level": 3 } }, "archived": true, "avatar_url": "http://example.com/uploads/project/avatar/3/uploads/avatar.png", "license_url": "http://example.com/diaspora/diaspora-client/blob/master/LICENSE", "license": { "key": "lgpl-3.0", "name": "GNU Lesser General Public License v3.0", "nickname": "GNU LGPLv3", "html_url": "http://choosealicense.com/licenses/lgpl-3.0/", "source_url": "http://www.gnu.org/licenses/lgpl-3.0.txt" }, "shared_runners_enabled": true, "forks_count": 0, "star_count": 0, "runners_token": "b8bc4a7a29eb76ea83cf79e4908c2b", "ci_default_git_depth": 50, "public_jobs": true, "shared_with_groups": [], "only_allow_merge_if_pipeline_succeeds": false, "allow_merge_on_skipped_pipeline": false, "only_allow_merge_if_all_discussions_are_resolved": false, "remove_source_branch_after_merge": false, "request_access_enabled": false, "merge_method": "merge", "autoclose_referenced_issues": true, "suggestion_commit_message": null, "_links": { "self": "http://example.com/api/v4/projects", "issues": "http://example.com/api/v4/projects/1/issues", "merge_requests": "http://example.com/api/v4/projects/1/merge_requests", "repo_branches": "http://example.com/api/v4/projects/1/repository_branches", "labels": "http://example.com/api/v4/projects/1/labels", "events": "http://example.com/api/v4/projects/1/events", "members": "http://example.com/api/v4/projects/1/members" } }
```
## Unarchive a project[](#unarchive-a-project "Permalink")
如果用戶是該項目的管理員或項目所有者,則取消歸檔該項目. 此操作是冪等的,因此取消存檔未存檔的項目不會更改該項目.
```
POST /projects/:id/unarchive
```
| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 項目的 ID 或[URL 編碼的路徑](README.html#namespaced-path-encoding) |
```
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/unarchive"
```
響應示例:
```
{ "id": 3, "description": null, "default_branch": "master", "visibility": "private", "ssh_url_to_repo": "git@example.com:diaspora/diaspora-project-site.git", "http_url_to_repo": "http://example.com/diaspora/diaspora-project-site.git", "web_url": "http://example.com/diaspora/diaspora-project-site", "readme_url": "http://example.com/diaspora/diaspora-project-site/blob/master/README.md", "tag_list": [ "example", "disapora project" ], "owner": { "id": 3, "name": "Diaspora", "created_at": "2013-09-30T13:46:02Z" }, "name": "Diaspora Project Site", "name_with_namespace": "Diaspora / Diaspora Project Site", "path": "diaspora-project-site", "path_with_namespace": "diaspora/diaspora-project-site", "issues_enabled": true, "open_issues_count": 1, "merge_requests_enabled": true, "jobs_enabled": true, "wiki_enabled": true, "snippets_enabled": false, "can_create_merge_request_in": true, "resolve_outdated_diff_discussions": false, "container_registry_enabled": false, "created_at": "2013-09-30T13:46:02Z", "last_activity_at": "2013-09-30T13:46:02Z", "creator_id": 3, "namespace": { "id": 3, "name": "Diaspora", "path": "diaspora", "kind": "group", "full_path": "diaspora" }, "import_status": "none", "import_error": null, "permissions": { "project_access": { "access_level": 10, "notification_level": 3 }, "group_access": { "access_level": 50, "notification_level": 3 } }, "archived": false, "avatar_url": "http://example.com/uploads/project/avatar/3/uploads/avatar.png", "license_url": "http://example.com/diaspora/diaspora-client/blob/master/LICENSE", "license": { "key": "lgpl-3.0", "name": "GNU Lesser General Public License v3.0", "nickname": "GNU LGPLv3", "html_url": "http://choosealicense.com/licenses/lgpl-3.0/", "source_url": "http://www.gnu.org/licenses/lgpl-3.0.txt" }, "shared_runners_enabled": true, "forks_count": 0, "star_count": 0, "runners_token": "b8bc4a7a29eb76ea83cf79e4908c2b", "ci_default_git_depth": 50, "public_jobs": true, "shared_with_groups": [], "only_allow_merge_if_pipeline_succeeds": false, "allow_merge_on_skipped_pipeline": false, "only_allow_merge_if_all_discussions_are_resolved": false, "remove_source_branch_after_merge": false, "request_access_enabled": false, "merge_method": "merge", "autoclose_referenced_issues": true, "suggestion_commit_message": null, "_links": { "self": "http://example.com/api/v4/projects", "issues": "http://example.com/api/v4/projects/1/issues", "merge_requests": "http://example.com/api/v4/projects/1/merge_requests", "repo_branches": "http://example.com/api/v4/projects/1/repository_branches", "labels": "http://example.com/api/v4/projects/1/labels", "events": "http://example.com/api/v4/projects/1/events", "members": "http://example.com/api/v4/projects/1/members" } }
```
## Remove project[](#remove-project "Permalink")
該端點:
* 刪除包含所有相關資源(問題,合并請求等)的項目.
* 從[Premium 或 Silver](https://about.gitlab.com/pricing/)或更高級別的[GitLab 12.6](https://gitlab.com/gitlab-org/gitlab/-/issues/32935)開始,將項目標記為刪除. 實際刪除發生在[實例設置中](../user/admin_area/settings/visibility_and_access_controls.html#default-deletion-adjourned-period-premium-only)指定的天數之后.
```
DELETE /projects/:id
```
| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 項目的 ID 或[URL 編碼的路徑](README.html#namespaced-path-encoding) |
## Restore project marked for deletion[](#restore-project-marked-for-deletion-premium "Permalink")
在 GitLab 12.6 中[引入](https://gitlab.com/gitlab-org/gitlab/-/issues/32935) .
恢復標記為刪除的項目.
```
POST /projects/:id/restore
```
| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 項目的 ID 或[URL 編碼的路徑](README.html#namespaced-path-encoding) |
## Upload a file[](#upload-a-file "Permalink")
將文件上載到指定的項目,以在發布或合并請求描述或注釋中使用.
```
POST /projects/:id/uploads
```
| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 項目的 ID 或[URL 編碼的路徑](README.html#namespaced-path-encoding) |
| `file` | string | yes | 要上傳的文件 |
要從文件系統上載文件,請使用`--form`參數. 這將導致 cURL 使用標題`Content-Type: multipart/form-data` . `file=`參數必須指向文件系統上的文件,并以`@`開頭. 例如:
```
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" --form "file=@dk.png" "https://gitlab.example.com/api/v4/projects/5/uploads"
```
Returned object:
```
{ "alt": "dk", "url": "/uploads/66dbcd21ec5d24ed6ea225176098d52b/dk.png", "full_path": "/namespace1/project1/uploads/66dbcd21ec5d24ed6ea225176098d52b/dk.png", "markdown": "" }
```
> **注意** :返回的`url`是相對于項目路徑的. 返回的`full_path`是文件的絕對路徑. 在 Markdown 上下文中,當使用`markdown`的格式時,鏈接會自動展開.
## Share project with group[](#share-project-with-group "Permalink")
允許與小組共享項目.
```
POST /projects/:id/share
```
| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 項目的 ID 或[URL 編碼的路徑](README.html#namespaced-path-encoding) |
| `group_id` | integer | yes | 與之共享的組的 ID |
| `group_access` | integer | yes | 授予組的[權限級別](members.html) |
| `expires_at` | string | no | ISO 8601 格式的股份到期日:2016-09-26 |
## Delete a shared project link within a group[](#delete-a-shared-project-link-within-a-group "Permalink")
從小組取消共享項目. 返回`204` ,成功則不返回任何內容.
```
DELETE /projects/:id/share/:group_id
```
| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 項目的 ID 或[URL 編碼的路徑](README.html#namespaced-path-encoding) |
| `group_id` | integer | yes | 組的 ID |
```
curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/share/17"
```
## Hooks[](#hooks "Permalink")
也稱為 Project Hooks 和 Webhooks. 對于系統范圍的[系統掛鉤](system_hooks.html) ,這些是不同的.
### List project hooks[](#list-project-hooks "Permalink")
獲取項目掛鉤的列表.
```
GET /projects/:id/hooks
```
| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 項目的 ID 或[URL 編碼的路徑](README.html#namespaced-path-encoding) |
### Get project hook[](#get-project-hook "Permalink")
獲取項目的特定掛鉤.
```
GET /projects/:id/hooks/:hook_id
```
| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 項目的 ID 或[URL 編碼的路徑](README.html#namespaced-path-encoding) |
| `hook_id` | integer | yes | 項目掛鉤的 ID |
```
{ "id": 1, "url": "http://example.com/hook", "project_id": 3, "push_events": true, "push_events_branch_filter": "", "issues_events": true, "confidential_issues_events": true, "merge_requests_events": true, "tag_push_events": true, "note_events": true, "confidential_note_events": true, "job_events": true, "pipeline_events": true, "wiki_page_events": true, "enable_ssl_verification": true, "created_at": "2012-10-12T17:04:47Z" }
```
### Add project hook[](#add-project-hook "Permalink")
將鉤子添加到指定項目.
```
POST /projects/:id/hooks
```
| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 項目的 ID 或[URL 編碼的路徑](README.html#namespaced-path-encoding) |
| `url` | string | yes | 掛鉤網址 |
| `push_events` | boolean | no | 在推送事件上觸發鉤子 |
| `push_events_branch_filter` | string | no | 觸發推送事件上的鉤子,僅用于匹配分支 |
| `issues_events` | boolean | no | 觸發問題事件掛鉤 |
| `confidential_issues_events` | boolean | no | 觸發機密問題事件的鉤子 |
| `merge_requests_events` | boolean | no | 觸發合并請求事件的鉤子 |
| `tag_push_events` | boolean | no | 觸發標簽推送事件的鉤子 |
| `note_events` | boolean | no | 在音符事件上觸發鉤子 |
| `confidential_note_events` | boolean | no | 觸發機密筆記事件的鉤子 |
| `job_events` | boolean | no | 觸發工作事件掛鉤 |
| `pipeline_events` | boolean | no | 觸發管道事件鉤子 |
| `wiki_page_events` | boolean | no | 觸發 Wiki 事件的鉤子 |
| `enable_ssl_verification` | boolean | no | 觸發掛鉤時執行 SSL 驗證 |
| `token` | string | no | 用于驗證收到的有效載荷的秘密令牌; 這將不會在響應中返回 |
### Edit project hook[](#edit-project-hook "Permalink")
Edits a hook for a specified project.
```
PUT /projects/:id/hooks/:hook_id
```
| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 項目的 ID 或[URL 編碼的路徑](README.html#namespaced-path-encoding) |
| `hook_id` | integer | yes | 項目掛鉤的 ID |
| `url` | string | yes | 掛鉤網址 |
| `push_events` | boolean | no | 在推送事件上觸發鉤子 |
| `push_events_branch_filter` | string | no | 觸發推送事件上的鉤子,僅用于匹配分支 |
| `issues_events` | boolean | no | Trigger hook on issues events |
| `confidential_issues_events` | boolean | no | 觸發機密問題事件的鉤子 |
| `merge_requests_events` | boolean | no | 觸發合并請求事件的鉤子 |
| `tag_push_events` | boolean | no | 觸發標簽推送事件的鉤子 |
| `note_events` | boolean | no | 在音符事件上觸發鉤子 |
| `confidential_note_events` | boolean | no | 觸發機密筆記事件的鉤子 |
| `job_events` | boolean | no | 觸發工作事件掛鉤 |
| `pipeline_events` | boolean | no | 觸發管道事件鉤子 |
| `wiki_events` | boolean | no | 觸發 Wiki 事件的鉤子 |
| `enable_ssl_verification` | boolean | no | 觸發掛鉤時執行 SSL 驗證 |
| `token` | string | no | 用于驗證收到的有效載荷的秘密令牌; 這將不會在響應中返回 |
### Delete project hook[](#delete-project-hook "Permalink")
從項目中刪除一個鉤子. 這是冪等方法,可以多次調用. 掛鉤是否可用.
```
DELETE /projects/:id/hooks/:hook_id
```
| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 項目的 ID 或[URL 編碼的路徑](README.html#namespaced-path-encoding) |
| `hook_id` | integer | yes | 項目掛鉤的 ID |
請注意,無論掛鉤是否可用,JSON 響應都會有所不同. 如果項目掛鉤在 JSON 響應中返回之前可用,或者返回空響應.
## Fork relationship[](#fork-relationship "Permalink")
允許修改現有項目之間的分支關系. 僅適用于項目所有者和管理員.
### Create a forked from/to relation between existing projects[](#create-a-forked-fromto-relation-between-existing-projects "Permalink")
```
POST /projects/:id/fork/:forked_from_id
```
| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 項目的 ID 或[URL 編碼的路徑](README.html#namespaced-path-encoding) |
| `forked_from_id` | ID | yes | 分叉的項目的 ID |
### Delete an existing forked from relationship[](#delete-an-existing-forked-from-relationship "Permalink")
```
DELETE /projects/:id/fork
```
| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 項目的 ID 或[URL 編碼的路徑](README.html#namespaced-path-encoding) |
## Search for projects by name[](#search-for-projects-by-name "Permalink")
通過名稱搜索可通過身份驗證的用戶訪問的項目. 如果可以公開訪問該項目,則無需身份驗證即可訪問該端點.
```
GET /projects
```
| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `search` | string | yes | 項目名稱中包含的字符串 |
| `order_by` | string | no | 返回按`id` , `name` , `created_at`或`last_activity_at`字段排序的請求 |
| `sort` | string | no | 返回請求按`asc`或`desc`排序 |
```
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects?search=test"
```
## Start the Housekeeping task for a Project[](#start-the-housekeeping-task-for-a-project "Permalink")
在 GitLab 9.0 中引入.
```
POST /projects/:id/housekeeping
```
| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 項目或 NAMESPACE / PROJECT_NAME 的 ID |
## Push Rules[](#push-rules-starter "Permalink")
### Get project push rules[](#get-project-push-rules "Permalink")
獲取項目的推送規則.
```
GET /projects/:id/push_rule
```
| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 項目或 NAMESPACE / PROJECT_NAME 的 ID |
```
{ "id": 1, "project_id": 3, "commit_message_regex": "Fixes \d+\..*", "commit_message_negative_regex": "ssh\:\/\/", "branch_name_regex": "", "deny_delete_tag": false, "created_at": "2012-10-12T17:04:47Z", "member_check": false, "prevent_secrets": false, "author_email_regex": "", "file_name_regex": "", "max_file_size": 5, "commit_committer_check": false, "reject_unsigned_commits": false }
```
使用 GitLab [Premium,Silver 或更高版本的用戶](https://about.gitlab.com/pricing/)還將看到`commit_committer_check`和`reject_unsigned_commits`參數:
```
{ "id": 1, "project_id": 3, "commit_committer_check": false, "reject_unsigned_commits": false ... }
```
### Add project push rule[](#add-project-push-rule "Permalink")
將推送規則添加到指定項目.
```
POST /projects/:id/push_rule
```
| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 項目或 NAMESPACE / PROJECT_NAME 的 ID |
| `deny_delete_tag` | boolean | no | 拒絕刪除標簽 |
| `member_check` | boolean | no | 限制作者(電子郵件)對現有 GitLab 用戶的提交 |
| `prevent_secrets` | boolean | no | GitLab 將拒絕任何可能包含機密的文件 |
| `commit_message_regex` | string | no | 所有提交消息都必須與此匹配,例如`Fixed \d+\..*` |
| `commit_message_negative_regex` | string | no | 不允許任何提交消息與此匹配,例如`ssh\:\/\/` |
| `branch_name_regex` | string | no | 所有分支名稱必須與此匹配,例如`(feature|hotfix)\/*` |
| `author_email_regex` | string | no | 所有提交作者的電子郵件都必須與此匹配,例如`@my-company.com$` |
| `file_name_regex` | string | no | 所有提交的文件名都**不能**與此匹配,例如`(jar|exe)$` |
| `max_file_size` | integer | no | 檔案大小上限(MB) |
| `commit_committer_check` | boolean | no | 用戶只能將使用自己的已驗證電子郵件之一提交的提交推送到該存儲庫. |
| `reject_unsigned_commits` | boolean | no | 如果未通過 GPG 簽名,則拒絕提交. |
### Edit project push rule[](#edit-project-push-rule "Permalink")
編輯指定項目的推送規則.
```
PUT /projects/:id/push_rule
```
| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 項目或 NAMESPACE / PROJECT_NAME 的 ID |
| `deny_delete_tag` | boolean | no | 拒絕刪除標簽 |
| `member_check` | boolean | no | 限制作者(電子郵件)對現有 GitLab 用戶的提交 |
| `prevent_secrets` | boolean | no | GitLab will reject any files that are likely to contain secrets |
| `commit_message_regex` | string | no | 所有提交消息都必須與此匹配,例如`Fixed \d+\..*` |
| `commit_message_negative_regex` | string | no | 不允許任何提交消息與此匹配,例如`ssh\:\/\/` |
| `branch_name_regex` | string | no | 所有分支名稱必須與此匹配,例如`(feature|hotfix)\/*` |
| `author_email_regex` | string | no | 所有提交作者的電子郵件都必須與此匹配,例如`@my-company.com$` |
| `file_name_regex` | string | no | 所有提交的文件名都**不能**與此匹配,例如`(jar|exe)$` |
| `max_file_size` | integer | no | 檔案大小上限(MB) |
| `commit_committer_check` | boolean | no | 用戶只能將使用自己的已驗證電子郵件之一提交的提交推送到該存儲庫. |
| `reject_unsigned_commits` | boolean | no | 沒有 GPG 簽名時拒絕提交. |
### Delete project push rule[](#delete-project-push-rule "Permalink")
在[GitLab Starter](https://about.gitlab.com/pricing/) 9.0 中引入.
從項目中刪除推送規則. 這是冪等方法,可以多次調用. 推送規則是否可用.
```
DELETE /projects/:id/push_rule
```
| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 項目的 ID 或[URL 編碼的路徑](README.html#namespaced-path-encoding) |
## Transfer a project to a new namespace[](#transfer-a-project-to-a-new-namespace "Permalink")
在 GitLab 11.1 中引入.
```
PUT /projects/:id/transfer
```
| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 項目的 ID 或[URL 編碼的路徑](README.html#namespaced-path-encoding) |
| `namespace` | integer/string | yes | 要轉移到項目的名稱空間的 ID 或路徑 |
## Branches[](#branches "Permalink")
在" [分支機構"](branches.html)文檔中了解更多信息.
## Project Import/Export[](#project-importexport "Permalink")
在[項目導入/導出](project_import_export.html)文檔中了解更多信息.
## Project members[](#project-members "Permalink")
在[項目成員](members.html)文檔中了解更多信息.
## Start the pull mirroring process for a Project[](#start-the-pull-mirroring-process-for-a-project-starter "Permalink")
在[GitLab Starter](https://about.gitlab.com/pricing/) 10.3 中引入.
```
POST /projects/:id/mirror/pull
```
| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 項目的 ID 或[URL 編碼的路徑](README.html#namespaced-path-encoding) |
```
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/:id/mirror/pull"
```
## Project badges[](#project-badges "Permalink")
在[Project Badges](project_badges.html)文檔中了解更多信息.
## Issue and merge request description templates[](#issue-and-merge-request-description-templates "Permalink")
非默認的[問題和合并請求描述模板](../user/project/description_templates.html)在項目的存儲庫中進行管理. 因此,您可以通過[Repositories API](repositories.html)和[Repository Files API](repository_files.html)通過 API 管理它們.
## Download snapshot of a Git repository[](#download-snapshot-of-a-git-repository "Permalink")
在 GitLab 10.7 中引入
該端點只能由管理用戶訪問.
下載項目(或 Wiki,如果需要)Git 存儲庫的快照. 該快照始終為未壓縮的[tar](https://en.wikipedia.org/wiki/Tar_(computing))格式.
如果存儲庫損壞到`git clone`不起作用的程度,則快照可能允許檢索某些數據.
```
GET /projects/:id/snapshot
```
| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 項目的 ID 或[URL 編碼的路徑](README.html#namespaced-path-encoding) |
| `wiki` | boolean | no | 是否下載 Wiki,而不是項目存儲庫 |
- GitLab Docs
- Installation
- Requirements
- GitLab cloud native Helm Chart
- Install GitLab with Docker
- Installation from source
- Install GitLab on Microsoft Azure
- Installing GitLab on Google Cloud Platform
- Installing GitLab on Amazon Web Services (AWS)
- Analytics
- Code Review Analytics
- Productivity Analytics
- Value Stream Analytics
- Kubernetes clusters
- Adding and removing Kubernetes clusters
- Adding EKS clusters
- Adding GKE clusters
- Group-level Kubernetes clusters
- Instance-level Kubernetes clusters
- Canary Deployments
- Cluster Environments
- Deploy Boards
- GitLab Managed Apps
- Crossplane configuration
- Cluster management project (alpha)
- Kubernetes Logs
- Runbooks
- Serverless
- Deploying AWS Lambda function using GitLab CI/CD
- Securing your deployed applications
- Groups
- Contribution Analytics
- Custom group-level project templates
- Epics
- Manage epics
- Group Import/Export
- Insights
- Issues Analytics
- Iterations
- Public access
- SAML SSO for GitLab.com groups
- SCIM provisioning using SAML SSO for GitLab.com groups
- Subgroups
- Roadmap
- Projects
- GitLab Secure
- Security Configuration
- Container Scanning
- Dependency Scanning
- Dependency List
- Static Application Security Testing (SAST)
- Secret Detection
- Dynamic Application Security Testing (DAST)
- GitLab Security Dashboard
- Offline environments
- Standalone Vulnerability pages
- Security scanner integration
- Badges
- Bulk editing issues and merge requests at the project level
- Code Owners
- Compliance
- License Compliance
- Compliance Dashboard
- Create a project
- Description templates
- Deploy Keys
- Deploy Tokens
- File finder
- Project integrations
- Integrations
- Atlassian Bamboo CI Service
- Bugzilla Service
- Custom Issue Tracker service
- Discord Notifications service
- Enabling emails on push
- GitHub project integration
- Hangouts Chat service
- Atlassian HipChat
- Irker IRC Gateway
- GitLab Jira integration
- Mattermost Notifications Service
- Mattermost slash commands
- Microsoft Teams service
- Mock CI Service
- Prometheus integration
- Redmine Service
- Slack Notifications Service
- Slack slash commands
- GitLab Slack application
- Webhooks
- YouTrack Service
- Insights
- Issues
- Crosslinking Issues
- Design Management
- Confidential issues
- Due dates
- Issue Boards
- Issue Data and Actions
- Labels
- Managing issues
- Milestones
- Multiple Assignees for Issues
- Related issues
- Service Desk
- Sorting and ordering issue lists
- Issue weight
- Associate a Zoom meeting with an issue
- Merge requests
- Allow collaboration on merge requests across forks
- Merge Request Approvals
- Browser Performance Testing
- How to create a merge request
- Cherry-pick changes
- Code Quality
- Load Performance Testing
- Merge Request dependencies
- Fast-forward merge requests
- Merge when pipeline succeeds
- Merge request conflict resolution
- Reverting changes
- Reviewing and managing merge requests
- Squash and merge
- Merge requests versions
- Draft merge requests
- Members of a project
- Migrating projects to a GitLab instance
- Import your project from Bitbucket Cloud to GitLab
- Import your project from Bitbucket Server to GitLab
- Migrating from ClearCase
- Migrating from CVS
- Import your project from FogBugz to GitLab
- Gemnasium
- Import your project from GitHub to GitLab
- Project importing from GitLab.com to your private GitLab instance
- Import your project from Gitea to GitLab
- Import your Jira project issues to GitLab
- Migrating from Perforce Helix
- Import Phabricator tasks into a GitLab project
- Import multiple repositories by uploading a manifest file
- Import project from repo by URL
- Migrating from SVN to GitLab
- Migrating from TFVC to Git
- Push Options
- Releases
- Repository
- Branches
- Git Attributes
- File Locking
- Git file blame
- Git file history
- Repository mirroring
- Protected branches
- Protected tags
- Push Rules
- Reduce repository size
- Signing commits with GPG
- Syntax Highlighting
- GitLab Web Editor
- Web IDE
- Requirements Management
- Project settings
- Project import/export
- Project access tokens (Alpha)
- Share Projects with other Groups
- Snippets
- Static Site Editor
- Wiki
- Project operations
- Monitor metrics for your CI/CD environment
- Set up alerts for Prometheus metrics
- Embedding metric charts within GitLab-flavored Markdown
- Embedding Grafana charts
- Using the Metrics Dashboard
- Dashboard YAML properties
- Metrics dashboard settings
- Panel types for dashboards
- Using Variables
- Templating variables for metrics dashboards
- Prometheus Metrics library
- Monitoring AWS Resources
- Monitoring HAProxy
- Monitoring Kubernetes
- Monitoring NGINX
- Monitoring NGINX Ingress Controller
- Monitoring NGINX Ingress Controller with VTS metrics
- Alert Management
- Error Tracking
- Tracing
- Incident Management
- GitLab Status Page
- Feature Flags
- GitLab CI/CD
- GitLab CI/CD pipeline configuration reference
- GitLab CI/CD include examples
- Introduction to CI/CD with GitLab
- Getting started with GitLab CI/CD
- How to enable or disable GitLab CI/CD
- Using SSH keys with GitLab CI/CD
- Migrating from CircleCI
- Migrating from Jenkins
- Auto DevOps
- Getting started with Auto DevOps
- Requirements for Auto DevOps
- Customizing Auto DevOps
- Stages of Auto DevOps
- Upgrading PostgreSQL for Auto DevOps
- Cache dependencies in GitLab CI/CD
- GitLab ChatOps
- Cloud deployment
- Docker integration
- Building Docker images with GitLab CI/CD
- Using Docker images
- Building images with kaniko and GitLab CI/CD
- GitLab CI/CD environment variables
- Predefined environment variables reference
- Where variables can be used
- Deprecated GitLab CI/CD variables
- Environments and deployments
- Protected Environments
- GitLab CI/CD Examples
- Test a Clojure application with GitLab CI/CD
- Using Dpl as deployment tool
- Testing a Phoenix application with GitLab CI/CD
- End-to-end testing with GitLab CI/CD and WebdriverIO
- DevOps and Game Dev with GitLab CI/CD
- Deploy a Spring Boot application to Cloud Foundry with GitLab CI/CD
- How to deploy Maven projects to Artifactory with GitLab CI/CD
- Testing PHP projects
- Running Composer and NPM scripts with deployment via SCP in GitLab CI/CD
- Test and deploy Laravel applications with GitLab CI/CD and Envoy
- Test and deploy a Python application with GitLab CI/CD
- Test and deploy a Ruby application with GitLab CI/CD
- Test and deploy a Scala application to Heroku
- GitLab CI/CD for external repositories
- Using GitLab CI/CD with a Bitbucket Cloud repository
- Using GitLab CI/CD with a GitHub repository
- GitLab Pages
- GitLab Pages
- GitLab Pages domain names, URLs, and baseurls
- Create a GitLab Pages website from scratch
- Custom domains and SSL/TLS Certificates
- GitLab Pages integration with Let's Encrypt
- GitLab Pages Access Control
- Exploring GitLab Pages
- Incremental Rollouts with GitLab CI/CD
- Interactive Web Terminals
- Optimizing GitLab for large repositories
- Metrics Reports
- CI/CD pipelines
- Pipeline Architecture
- Directed Acyclic Graph
- Multi-project pipelines
- Parent-child pipelines
- Pipelines for Merge Requests
- Pipelines for Merged Results
- Merge Trains
- Job artifacts
- Pipeline schedules
- Pipeline settings
- Triggering pipelines through the API
- Review Apps
- Configuring GitLab Runners
- GitLab CI services examples
- Using MySQL
- Using PostgreSQL
- Using Redis
- Troubleshooting CI/CD
- GitLab Package Registry
- GitLab Container Registry
- Dependency Proxy
- GitLab Composer Repository
- GitLab Conan Repository
- GitLab Maven Repository
- GitLab NPM Registry
- GitLab NuGet Repository
- GitLab PyPi Repository
- API Docs
- API resources
- .gitignore API
- GitLab CI YMLs API
- Group and project access requests API
- Appearance API
- Applications API
- Audit Events API
- Avatar API
- Award Emoji API
- Project badges API
- Group badges API
- Branches API
- Broadcast Messages API
- Project clusters API
- Group clusters API
- Instance clusters API
- Commits API
- Container Registry API
- Custom Attributes API
- Dashboard annotations API
- Dependencies API
- Deploy Keys API
- Deployments API
- Discussions API
- Dockerfiles API
- Environments API
- Epics API
- Events
- Feature Flags API
- Feature flag user lists API
- Freeze Periods API
- Geo Nodes API
- Group Activity Analytics API
- Groups API
- Import API
- Issue Boards API
- Group Issue Boards API
- Issues API
- Epic Issues API
- Issues Statistics API
- Jobs API
- Keys API
- Labels API
- Group Labels API
- License
- Licenses API
- Issue links API
- Epic Links API
- Managed Licenses API
- Markdown API
- Group and project members API
- Merge request approvals API
- Merge requests API
- Project milestones API
- Group milestones API
- Namespaces API
- Notes API
- Notification settings API
- Packages API
- Pages domains API
- Pipeline schedules API
- Pipeline triggers API
- Pipelines API
- Project Aliases API
- Project import/export API
- Project repository storage moves API
- Project statistics API
- Project templates API
- Projects API
- Protected branches API
- Protected tags API
- Releases API
- Release links API
- Repositories API
- Repository files API
- Repository submodules API
- Resource label events API
- Resource milestone events API
- Resource weight events API
- Runners API
- SCIM API
- Search API
- Services API
- Application settings API
- Sidekiq Metrics API
- Snippets API
- Project snippets
- Application statistics API
- Suggest Changes API
- System hooks API
- Tags API
- Todos API
- Users API
- Project-level Variables API
- Group-level Variables API
- Version API
- Vulnerabilities API
- Vulnerability Findings API
- Wikis API
- GraphQL API
- Getting started with GitLab GraphQL API
- GraphQL API Resources
- API V3 to API V4
- Validate the .gitlab-ci.yml (API)
- User Docs
- Abuse reports
- User account
- Active sessions
- Deleting a User account
- Permissions
- Personal access tokens
- Profile preferences
- Threads
- GitLab and SSH keys
- GitLab integrations
- Git
- GitLab.com settings
- Infrastructure as code with Terraform and GitLab
- GitLab keyboard shortcuts
- GitLab Markdown
- AsciiDoc
- GitLab Notification Emails
- GitLab Quick Actions
- Autocomplete characters
- Reserved project and group names
- Search through GitLab
- Advanced Global Search
- Advanced Syntax Search
- Time Tracking
- GitLab To-Do List
- Administrator Docs
- Reference architectures
- Reference architecture: up to 1,000 users
- Reference architecture: up to 2,000 users
- Reference architecture: up to 3,000 users
- Reference architecture: up to 5,000 users
- Reference architecture: up to 10,000 users
- Reference architecture: up to 25,000 users
- Reference architecture: up to 50,000 users
- Troubleshooting a reference architecture set up
- Working with the bundled Consul service
- Configuring PostgreSQL for scaling
- Configuring GitLab application (Rails)
- Load Balancer for multi-node GitLab
- Configuring a Monitoring node for Scaling and High Availability
- NFS
- Working with the bundled PgBouncer service
- Configuring Redis for scaling
- Configuring Sidekiq
- Admin Area settings
- Continuous Integration and Deployment Admin settings
- Custom instance-level project templates
- Diff limits administration
- Enable and disable GitLab features deployed behind feature flags
- Geo nodes Admin Area
- GitLab Pages administration
- Health Check
- Job logs
- Labels administration
- Log system
- PlantUML & GitLab
- Repository checks
- Repository storage paths
- Repository storage types
- Account and limit settings
- Service templates
- System hooks
- Changing your time zone
- Uploads administration
- Abuse reports
- Activating and deactivating users
- Audit Events
- Blocking and unblocking users
- Broadcast Messages
- Elasticsearch integration
- Gitaly
- Gitaly Cluster
- Gitaly reference
- Monitoring GitLab
- Monitoring GitLab with Prometheus
- Performance Bar
- Usage statistics
- Object Storage
- Performing Operations in GitLab
- Cleaning up stale Redis sessions
- Fast lookup of authorized SSH keys in the database
- Filesystem Performance Benchmarking
- Moving repositories managed by GitLab
- Run multiple Sidekiq processes
- Sidekiq MemoryKiller
- Switching to Puma
- Understanding Unicorn and unicorn-worker-killer
- User lookup via OpenSSH's AuthorizedPrincipalsCommand
- GitLab Package Registry administration
- GitLab Container Registry administration
- Replication (Geo)
- Geo database replication
- Geo with external PostgreSQL instances
- Geo configuration
- Using a Geo Server
- Updating the Geo nodes
- Geo with Object storage
- Docker Registry for a secondary node
- Geo for multiple nodes
- Geo security review (Q&A)
- Location-aware Git remote URL with AWS Route53
- Tuning Geo
- Removing secondary Geo nodes
- Geo data types support
- Geo Frequently Asked Questions
- Geo Troubleshooting
- Geo validation tests
- Disaster Recovery (Geo)
- Disaster recovery for planned failover
- Bring a demoted primary node back online
- Automatic background verification
- Rake tasks
- Back up and restore GitLab
- Clean up
- Namespaces
- Maintenance Rake tasks
- Geo Rake Tasks
- GitHub import
- Import bare repositories
- Integrity check Rake task
- LDAP Rake tasks
- Listing repository directories
- Praefect Rake tasks
- Project import/export administration
- Repository storage Rake tasks
- Generate sample Prometheus data
- Uploads migrate Rake tasks
- Uploads sanitize Rake tasks
- User management
- Webhooks administration
- X.509 signatures
- Server hooks
- Static objects external storage
- Updating GitLab
- GitLab release and maintenance policy
- Security
- Password Storage
- Custom password length limits
- Restrict allowed SSH key technologies and minimum length
- Rate limits
- Webhooks and insecure internal web services
- Information exclusivity
- How to reset your root password
- How to unlock a locked user from the command line
- User File Uploads
- How we manage the TLS protocol CRIME vulnerability
- User email confirmation at sign-up
- Security of running jobs
- Proxying assets
- CI/CD Environment Variables
- Contributor and Development Docs
- Contribute to GitLab
- Community members & roles
- Implement design & UI elements
- Issues workflow
- Merge requests workflow
- Code Review Guidelines
- Style guides
- GitLab Architecture Overview
- CI/CD development documentation
- Database guides
- Database Review Guidelines
- Database Review Guidelines
- Migration Style Guide
- What requires downtime?
- Understanding EXPLAIN plans
- Rake tasks for developers
- Mass inserting Rails models
- GitLab Documentation guidelines
- Documentation Style Guide
- Documentation structure and template
- Documentation process
- Documentation site architecture
- Global navigation
- GitLab Docs monthly release process
- Telemetry Guide
- Usage Ping Guide
- Snowplow Guide
- Experiment Guide
- Feature flags in development of GitLab
- Feature flags process
- Developing with feature flags
- Feature flag controls
- Document features deployed behind feature flags
- Frontend Development Guidelines
- Accessibility & Readability
- Ajax
- Architecture
- Axios
- Design Patterns
- Frontend Development Process
- DropLab
- Emojis
- Filter
- Frontend FAQ
- GraphQL
- Icons and SVG Illustrations
- InputSetter
- Performance
- Principles
- Security
- Tooling
- Vuex
- Vue
- Geo (development)
- Geo self-service framework (alpha)
- Gitaly developers guide
- GitLab development style guides
- API style guide
- Go standards and style guidelines
- GraphQL API style guide
- Guidelines for shell commands in the GitLab codebase
- HTML style guide
- JavaScript style guide
- Migration Style Guide
- Newlines style guide
- Python Development Guidelines
- SCSS style guide
- Shell scripting standards and style guidelines
- Sidekiq debugging
- Sidekiq Style Guide
- SQL Query Guidelines
- Vue.js style guide
- Instrumenting Ruby code
- Testing standards and style guidelines
- Flaky tests
- Frontend testing standards and style guidelines
- GitLab tests in the Continuous Integration (CI) context
- Review Apps
- Smoke Tests
- Testing best practices
- Testing levels
- Testing Rails migrations at GitLab
- Testing Rake tasks
- End-to-end Testing
- Beginner's guide to writing end-to-end tests
- End-to-end testing Best Practices
- Dynamic Element Validation
- Flows in GitLab QA
- Page objects in GitLab QA
- Resource class in GitLab QA
- Style guide for writing end-to-end tests
- Testing with feature flags
- Translate GitLab to your language
- Internationalization for GitLab
- Translating GitLab
- Proofread Translations
- Merging translations from CrowdIn
- Value Stream Analytics development guide
- GitLab subscription
- Activate GitLab EE with a license