summaryrefslogtreecommitdiff
path: root/doc/workflow
diff options
context:
space:
mode:
Diffstat (limited to 'doc/workflow')
-rw-r--r--doc/workflow/merge_requests.md19
1 files changed, 19 insertions, 0 deletions
diff --git a/doc/workflow/merge_requests.md b/doc/workflow/merge_requests.md
index d2ec56e6504..91fcfb02d39 100644
--- a/doc/workflow/merge_requests.md
+++ b/doc/workflow/merge_requests.md
@@ -15,6 +15,25 @@ Please note that you need to have builds configured to enable this feature.
## Checkout merge requests locally
+### By adding a git alias
+
+Add the following alias to your `~/.gitconfig`:
+
+```
+[alias]
+ mr = !sh -c 'git fetch $1 merge-requests/$2/head:mr-$1-$2 && git checkout mr-$1-$2' -
+```
+
+Now you can check out a particular merge request from any repository and any remote, e.g. to check out a merge request number 5 as shown in GitLab from the `upstream` remote, do:
+
+```
+$ git mr upstream 5
+```
+
+This will fetch the merge request into a local `mr-upstream-5` branch and check it out.
+
+### By modifying `.git/config` for a given repository
+
Locate the section for your GitLab remote in the `.git/config` file. It looks like this:
```