文档

修改文件

更新时间:

该接口用于修改文件内容

请求方式PUT/api/v4/projects/[ProjectId]/repository/files

请求Action:UpdateFile

请求参数:

参数名

类型

说明

是否必须

默认值

ProjectId

long

代码库id

请求 body

{
  "branch_name": "string",
  "commit_message": "string",
  "content": "string",
  "encoding": "text",
  "new_path": "string",
  "old_path": "string"
}

body参数说明

参数名

类型

说明

是否必须

默认值

branch_name

string

文件所在分支

commit_message

string

提交信息

content

string

文件内容

encoding

string

编码规则

可选:

text

base64

text

new_path

string

修改后的文件路径

old_path

string

要修改的文件路径

返回 body :

{
   "ErrorCode": "",
   "ErrorMessage": "",
   "RequestId": "",
   "Success": true,
   "Result": {
  "BranchName": "",
  "FilePath": "",
    }
}

返回结果说明:

参数名

类型

说明

BranchName

string

分支名称

FilePath

string

文件路径

  • 本页导读 (0)