跳到主要内容

Update File

PUT 

/api/v5/repos/:owner/:repo/contents/:path

Request​

Path Parameters

    owner stringrequired

    Repository space address (organization or individual's address path)

    repo stringrequired

    Repository path (path)

    path stringrequired

    The path of the file.

Query Parameters

    access_token stringrequired

    User authorization code

Body

    contentstringrequired

    File content to be base64 encoded

    shastringrequired

    The Blob SHA of the file

    branchstring

    Branch name. Defaults to the repository's default branch.

    messagestringrequired

    commit message

    author[name]string

    Author's name, defaults to the current user's name

    author[email]string

    Author's email, defaults to the current user's email.

Responses​

Successful Response

Response Headers
    Schema
      commit objectrequired
      shastringrequired
      author objectrequired
      namestringrequired
      emailstringrequired
      datestringrequired
      committer objectrequired
      namestringrequired
      emailstringrequired
      datestringrequired
      messagestringrequired
      treestringrequired
      parentsstring[]required
      content objectrequired
      namestringrequired
      pathstringrequired
      sizeintegerrequired
      shastringrequired
      typestringrequired