Commit 88d397f4 authored by Johann MacDonagh's avatar Johann MacDonagh

Instruct users to fetch merge request branch

Instructing users to create a new branch on the target branch and then
pulling creates a few issues. If the target branch has moved on since
the source branch diverged from it, then the pull will create an
unnecessary merge commit from the target branch to the source branch. If
the user has pull.rebase set to "true" or "preserve", then this creates
an even stranger history. These instructions will ensure the local
branch created for the merge request is exactly what contributing user
has pushed.
parent 54b89215
...@@ -10,11 +10,11 @@ ...@@ -10,11 +10,11 @@
- target_remote = @merge_request.target_project.namespace.nil? ? "target" :@merge_request.target_project.namespace.path - target_remote = @merge_request.target_project.namespace.nil? ? "target" :@merge_request.target_project.namespace.path
%p %p
%strong Step 1. %strong Step 1.
Checkout the branch we are going to merge and pull in the code Fetch the code and create a new branch pointing to it
%pre.dark %pre.dark
:preserve :preserve
git checkout -b #{@merge_request.source_project_path}-#{@merge_request.source_branch} #{@merge_request.target_branch} git fetch #{@merge_request.source_project.http_url_to_repo} #{@merge_request.source_branch}
git pull #{@merge_request.source_project.http_url_to_repo} #{@merge_request.source_branch} git checkout -b #{@merge_request.source_project_path}-#{@merge_request.source_branch} FETCH_HEAD
%p %p
%strong Step 2. %strong Step 2.
Merge the branch and push the changes to GitLab Merge the branch and push the changes to GitLab
......
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