diff options
author | Ondřej Čertík <ondrej.certik@gmail.com> | 2016-08-23 13:05:34 -0600 |
---|---|---|
committer | Ondřej Čertík <ondrej.certik@gmail.com> | 2016-08-23 13:07:16 -0600 |
commit | a7bd1c23dd03f00d10b0ff4db655690283e2f88a (patch) | |
tree | 33fe6e65d6c9b6670ac845b5e497f8eeb3026f3e /doc | |
parent | d1ed0c76ec7e9ef4ec1ccff2756433997b3a2397 (diff) | |
download | gitlab-ce-a7bd1c23dd03f00d10b0ff4db655690283e2f88a.tar.gz |
Modify the alias to allow specifying a remote
Now the alias should be used as:
git mr upstream 5
To check out a MR number 5 from the upstream remote, into a `mr-upstream-5`
local branch.
Also clarify that the `5` in the merge request is the number shown in GitLab.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/workflow/merge_requests.md | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/doc/workflow/merge_requests.md b/doc/workflow/merge_requests.md index adee26f0fe9..91fcfb02d39 100644 --- a/doc/workflow/merge_requests.md +++ b/doc/workflow/merge_requests.md @@ -21,16 +21,16 @@ Add the following alias to your `~/.gitconfig`: ``` [alias] - mr = !sh -c 'git fetch origin merge-requests/$1/head:mr-$1 && git checkout mr-$1' - + 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 (it will use the `origin` remote) by: +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 5 +$ git mr upstream 5 ``` -This will fetch the merge request into a local `mr-5` branch and check it out. +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 |