summaryrefslogtreecommitdiff
path: root/docs/faq.rst
diff options
context:
space:
mode:
authorJoost Evertse <joustie@gmail.com>2019-01-21 13:36:56 +0100
committerGitHub <noreply@github.com>2019-01-21 13:36:56 +0100
commitb51d2969ad34a9aad79e42a69f275caf2a4059cb (patch)
treea4519d935a0b5ae5361cb178318402e09da17d75 /docs/faq.rst
parent53f7de7bfe0056950a8e7271632da3f89e3ba3b3 (diff)
parent52d76312660109d3669d459b11b448a3a60b9603 (diff)
downloadgitlab-b51d2969ad34a9aad79e42a69f275caf2a4059cb.tar.gz
Merge branch 'master' into master
Diffstat (limited to 'docs/faq.rst')
-rw-r--r--docs/faq.rst33
1 files changed, 33 insertions, 0 deletions
diff --git a/docs/faq.rst b/docs/faq.rst
new file mode 100644
index 0000000..fe71198
--- /dev/null
+++ b/docs/faq.rst
@@ -0,0 +1,33 @@
+###
+FAQ
+###
+
+I cannot edit the merge request / issue I've just retrieved
+ It is likely that you used a ``MergeRequest``, ``GroupMergeRequest``,
+ ``Issue`` or ``GroupIssue`` object. These objects cannot be edited. But you
+ can create a new ``ProjectMergeRequest`` or ``ProjectIssue`` object to
+ apply changes. For example::
+
+ issue = gl.issues.list()[0]
+ project = gl.projects.get(issue.project_id, lazy=True)
+ editable_issue = project.issues.get(issue.iid, lazy=True)
+ # you can now edit the object
+
+ See the :ref:`merge requests example <merge_requests_examples>` and the
+ :ref:`issues examples <issues_examples>`.
+
+How can I clone the repository of a project?
+ python-gitlab doesn't provide an API to clone a project. You have to use a
+ git library or call the ``git`` command.
+
+ The git URI is exposed in the ``ssh_url_to_repo`` attribute of ``Project``
+ objects.
+
+ Example::
+
+ import subprocess
+
+ project = gl.projects.create(data) # or gl.projects.get(project_id)
+ print(project.attributes) # displays all the attributes
+ git_url = project.ssh_url_to_repo
+ subprocess.call(['git', 'clone', git_url])