GitLab wurde erfolgreich aktualisiert. Dank regelmäßiger Updates bleibt das THM GitLab sicher und Sie profitieren von den neuesten Funktionen. Danke für Ihre Geduld.

Create ref for every merge request. Add documentation for fetch merge requests

Signed-off-by: default avatarDmitriy Zaporozhets <>
parent 8dce6623
......@@ -161,8 +161,8 @@ def repository
def compare_result
@compare_result ||=
# Update ref if merge request is from fork
merge_request.fetch_ref if merge_request.for_fork?
# Update ref for merge request
# Get latest sha of branch from source project
source_sha = merge_request.source_project.commit(source_branch).sha
# Merge Requests
Merge requests allow you to exchange changes you made to source code
## Checkout merge requests locally
Locate the section for your GitLab remote in the `.git/config` file. It looks like this:
[remote "origin"]
url =
fetch = +refs/heads/*:refs/remotes/origin/*
Now add the line `fetch = +refs/merge-requests/*/head:refs/remotes/origin/merge-requests/*` to this section.
It should looks like this:
[remote "origin"]
url =
fetch = +refs/heads/*:refs/remotes/origin/*
fetch = +refs/merge-requests/*/head:refs/remotes/origin/merge-requests/*
Now you can fetch all the merge requests requests:
$ git fetch origin
* [new ref] refs/merge-requests/1/head -> origin/merge-requests/1
* [new ref] refs/merge-requests/2/head -> origin/merge-requests/2
To check out a particular merge request:
$ git checkout origin/merge-requests/1
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment