Commit 09eccf4745a715013361c332b23b82ffb310af4b

Authored by dosire
1 parent 03770698

Instructions should create a merge commit and give people a chance to test the b…

…ranch we are going to merge.
app/views/projects/merge_requests/show/_how_to_merge.html.haml
@@ -10,34 +10,38 @@ @@ -10,34 +10,38 @@
10 - target_remote = @merge_request.target_project.namespace.nil? ? "target" :@merge_request.target_project.namespace.path 10 - target_remote = @merge_request.target_project.namespace.nil? ? "target" :@merge_request.target_project.namespace.path
11 %p 11 %p
12 %strong Step 1. 12 %strong Step 1.
13 - Checkout target branch and get recent objects from GitLab  
14 - Assuming remote for #{@merge_request.target_project.path_with_namespace} is called #{target_remote}  
15 - remote for #{@merge_request.source_project_path} is called #{source_remote} 13 + Update the repo and checkout the branch we are going to merge
  14 + Assuming remote for #{@merge_request.target_project.path_with_namespace} is called #{target_remote}
  15 + remote for #{@merge_request.source_project_path} is called #{source_remote}
16 %pre.dark 16 %pre.dark
17 :preserve 17 :preserve
18 - git checkout #{target_remote} #{@merge_request.target_branch}  
19 git fetch #{source_remote} 18 git fetch #{source_remote}
  19 + git fetch #{target_remote}
  20 + git checkout -b {@merge_request.source_branch} #{source_remote}/#{@merge_request.source_branch}
20 %p 21 %p
21 %strong Step 2. 22 %strong Step 2.
22 - Merge source branch into target branch and push changes to GitLab 23 + Merge the source branch into target branch and push changes to GitLab
23 %pre.dark 24 %pre.dark
24 :preserve 25 :preserve
25 - git merge #{source_remote}/#{@merge_request.source_branch} 26 + git checkout #{target_remote}/#{@merge_request.target_branch}
  27 + git merge --no-ff #{@merge_request.source_branch}
26 git push #{target_remote} #{@merge_request.target_branch} 28 git push #{target_remote} #{@merge_request.target_branch}
  29 + git branch -d {@merge_request.source_branch}
27 - else 30 - else
28 %p 31 %p
29 %strong Step 1. 32 %strong Step 1.
30 - Checkout target branch and get recent objects from GitLab 33 + Update the repo and checkout the branch we are going to merge
31 %pre.dark 34 %pre.dark
32 :preserve 35 :preserve
33 - git checkout #{@merge_request.target_branch}  
34 git fetch origin 36 git fetch origin
  37 + git checkout -b #{@merge_request.source_branch}
35 %p 38 %p
36 %strong Step 2. 39 %strong Step 2.
37 - Merge source branch into target branch and push changes to GitLab 40 + Merge the source branch into target branch and push changes to GitLab
38 %pre.dark 41 %pre.dark
39 :preserve 42 :preserve
40 - git merge origin/#{@merge_request.source_branch} 43 + git checkout #{@merge_request.target_branch}
  44 + git merge --no-ff #{@merge_request.source_branch}
41 git push origin #{@merge_request.target_branch} 45 git push origin #{@merge_request.target_branch}
42 46
43 47