Fork a Repository
POST/api/v5/repos/:owner/:repo/forks
Request
Path Parameters
owner stringrequired
Repository space address (address path of the enterprise, organization, or individual)
repo stringrequired
Repository path (path)
Query Parameters
access_token stringrequired
User authorization code
- application/json
Body
organizationstring
Full address of the organizational space. If not filled, it defaults to forking to the user's personal space address.
namestring
Name of the repository after forking. Defaults to the source repository name.
pathstring
Forked repository address after forking. Default: Source repository address
Responses
- 200
Successful Response
Response Headers
- application/json
- Schema
- Example (auto)
- 1
Schema
idinteger
full_namestring
human_namestring
urlstring
namespace object
idinteger
namestring
pathstring
develop_modestring
cellstring
kindstring
full_pathstring
full_namestring
visibility_levelinteger
enable_file_controlinteger
{
"id": 0,
"full_name": "string",
"human_name": "string",
"url": "string",
"namespace": {
"id": 0,
"name": "string",
"path": "string",
"develop_mode": "string",
"cell": "string",
"kind": "string",
"full_path": "string",
"full_name": "string",
"visibility_level": 0,
"enable_file_control": 0
}
}
Successful Example
{
"id": 729292,
"full_name": "xiaogang_test/fork2",
"human_name": "test organization / fork2",
"url": "https://api.gitcode.com/api/v5/repos/xiaogang_test/fork2",
"namespace": {
"id": 138108,
"name": "test organization",
"path": "xiaogang_test",
"develop_mode": "normal",
"cell": "default",
"kind": "group",
"full_path": "xiaogang_test",
"full_name": "test organization",
"visibility_level": 20,
"enable_file_control": false
}
}