Commit f46620e6f4d01e4a204dc79104a6934f43c707af
1 parent
09eccf47
Exists in
spb-stable
and in
3 other branches
Instead of working with remotes Dmitriy suggested to use urls.
Showing
1 changed file
with
9 additions
and
13 deletions
Show diff stats
app/views/projects/merge_requests/show/_how_to_merge.html.haml
... | ... | @@ -10,23 +10,19 @@ |
10 | 10 | - target_remote = @merge_request.target_project.namespace.nil? ? "target" :@merge_request.target_project.namespace.path |
11 | 11 | %p |
12 | 12 | %strong Step 1. |
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} | |
13 | + Checkout the branch we are going to merge and pull in the code | |
16 | 14 | %pre.dark |
17 | 15 | :preserve |
18 | - git fetch #{source_remote} | |
19 | - git fetch #{target_remote} | |
20 | - git checkout -b {@merge_request.source_branch} #{source_remote}/#{@merge_request.source_branch} | |
16 | + git checkout -b #{@merge_request.source_project_path}-#{@merge_request.source_branch} #{@merge_request.target_branch} | |
17 | + git pull #{@merge_request.source_project.http_url_to_repo} #{@merge_request.source_branch} | |
21 | 18 | %p |
22 | 19 | %strong Step 2. |
23 | - Merge the source branch into target branch and push changes to GitLab | |
20 | + Merge the branch and push the changes to GitLab | |
24 | 21 | %pre.dark |
25 | 22 | :preserve |
26 | - git checkout #{target_remote}/#{@merge_request.target_branch} | |
27 | - git merge --no-ff #{@merge_request.source_branch} | |
28 | - git push #{target_remote} #{@merge_request.target_branch} | |
29 | - git branch -d {@merge_request.source_branch} | |
23 | + git checkout #{@merge_request.target_branch} | |
24 | + git merge --no-ff #{@merge_request.source_project_path}-#{@merge_request.source_branch} | |
25 | + git push origin #{@merge_request.target_branch} | |
30 | 26 | - else |
31 | 27 | %p |
32 | 28 | %strong Step 1. |
... | ... | @@ -34,10 +30,10 @@ |
34 | 30 | %pre.dark |
35 | 31 | :preserve |
36 | 32 | git fetch origin |
37 | - git checkout -b #{@merge_request.source_branch} | |
33 | + git checkout -b #{@merge_request.source_branch} origin/#{@merge_request.source_branch} | |
38 | 34 | %p |
39 | 35 | %strong Step 2. |
40 | - Merge the source branch into target branch and push changes to GitLab | |
36 | + Merge the branch and push the changes to GitLab | |
41 | 37 | %pre.dark |
42 | 38 | :preserve |
43 | 39 | git checkout #{@merge_request.target_branch} | ... | ... |