From 88d397f473a40236c7a03a7acf924a3640e70d9c Mon Sep 17 00:00:00 2001 From: Johann MacDonagh Date: Sat, 8 Feb 2014 21:47:20 -0500 Subject: [PATCH] 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. --- .../projects/merge_requests/show/_how_to_merge.html.haml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/projects/merge_requests/show/_how_to_merge.html.haml b/app/views/projects/merge_requests/show/_how_to_merge.html.haml index 9540453ce3e..63db4b30968 100644 --- a/app/views/projects/merge_requests/show/_how_to_merge.html.haml +++ b/app/views/projects/merge_requests/show/_how_to_merge.html.haml @@ -10,11 +10,11 @@ - target_remote = @merge_request.target_project.namespace.nil? ? "target" :@merge_request.target_project.namespace.path %p %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 :preserve - git checkout -b #{@merge_request.source_project_path}-#{@merge_request.source_branch} #{@merge_request.target_branch} - git pull #{@merge_request.source_project.http_url_to_repo} #{@merge_request.source_branch} + git fetch #{@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 %strong Step 2. Merge the branch and push the changes to GitLab