Method: Gitlab::Client::RepositoryFiles#remove_file

Defined in:
lib/gitlab/client/repository_files.rb

#remove_file(project, path, branch, commit_message, options = {}) ⇒ Gitlab::ObjectifiedHash

Removes an existing repository file.

Examples:

Gitlab.remove_file(42, "path", "branch", "commit message")

Parameters:

  • project (Integer, String)

    The ID or name of a project.

  • path (String)

    full path of file to delete.

  • branch (String)

    the name of the branch to commit the deletion to.

  • commit_message (String)

    …a commit message ;)

  • options (Hash) (defaults to: {})

    Optional additional details for commit

Options Hash (options):

  • :author_name (String)

    Commit author’s name

  • :author_email (String)

    Commit author’s email address

Returns:

[View source]

114
115
116
117
118
119
120
# File 'lib/gitlab/client/repository_files.rb', line 114

def remove_file(project, path, branch, commit_message, options = {})
  delete("/projects/#{url_encode project}/repository/files/#{url_encode path}",
         body: {
           branch: branch,
           commit_message: commit_message
         }.merge(options))
end