# 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": "![dk](/uploads/66dbcd21ec5d24ed6ea225176098d52b/dk.png)" }
```
> **注意** :返回的`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