Method: Gitlab::Client::Projects#create_fork

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

#create_fork(id, options = {}) ⇒ Gitlab::ObjectifiedHash

Forks a project into the user namespace.

Examples:

Gitlab.create_fork(42)
Gitlab.create_fork(42, { sudo: 'another_username' })

Parameters:

  • project (Integer, String)

    The ID or path of a project.

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

    A customizable set of options.

Options Hash (options):

  • :sudo (String)

    The username the project will be forked for

Returns:

[View source]

438
439
440
# File 'lib/gitlab/client/projects.rb', line 438

def create_fork(id, options = {})
  post("/projects/#{url_encode id}/fork", body: options)
end