summaryrefslogtreecommitdiff
path: root/doc/workflow/merge_requests.md
diff options
context:
space:
mode:
Diffstat (limited to 'doc/workflow/merge_requests.md')
-rw-r--r--doc/workflow/merge_requests.md15
1 files changed, 15 insertions, 0 deletions
diff --git a/doc/workflow/merge_requests.md b/doc/workflow/merge_requests.md
index d2ec56e6504..12ffa916a8f 100644
--- a/doc/workflow/merge_requests.md
+++ b/doc/workflow/merge_requests.md
@@ -15,6 +15,21 @@ 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 origin merge-requests/$1/head:mr-$1 && git checkout mr-$1' -
+```
+Now you can check out a particular merge request from any repository (it will use the `origin` remote) by:
+```
+$ git mr 5
+```
+This will fetch the merge request into a local `mr-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:
```