Commit f46620e6 authored by dosire's avatar dosire

Instead of working with remotes Dmitriy suggested to use urls.

parent 09eccf47
...@@ -10,23 +10,19 @@ ...@@ -10,23 +10,19 @@
- 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.
Update the repo and checkout the branch we are going to merge Checkout the branch we are going to merge and pull in the code
Assuming remote for #{@merge_request.target_project.path_with_namespace} is called #{target_remote}
remote for #{@merge_request.source_project_path} is called #{source_remote}
%pre.dark %pre.dark
:preserve :preserve
git fetch #{source_remote} git checkout -b #{@merge_request.source_project_path}-#{@merge_request.source_branch} #{@merge_request.target_branch}
git fetch #{target_remote} git pull #{@merge_request.source_project.http_url_to_repo} #{@merge_request.source_branch}
git checkout -b {@merge_request.source_branch} #{source_remote}/#{@merge_request.source_branch}
%p %p
%strong Step 2. %strong Step 2.
Merge the source branch into target branch and push changes to GitLab Merge the branch and push the changes to GitLab
%pre.dark %pre.dark
:preserve :preserve
git checkout #{target_remote}/#{@merge_request.target_branch} git checkout #{@merge_request.target_branch}
git merge --no-ff #{@merge_request.source_branch} git merge --no-ff #{@merge_request.source_project_path}-#{@merge_request.source_branch}
git push #{target_remote} #{@merge_request.target_branch} git push origin #{@merge_request.target_branch}
git branch -d {@merge_request.source_branch}
- else - else
%p %p
%strong Step 1. %strong Step 1.
...@@ -34,10 +30,10 @@ ...@@ -34,10 +30,10 @@
%pre.dark %pre.dark
:preserve :preserve
git fetch origin git fetch origin
git checkout -b #{@merge_request.source_branch} git checkout -b #{@merge_request.source_branch} origin/#{@merge_request.source_branch}
%p %p
%strong Step 2. %strong Step 2.
Merge the source branch into target branch and push changes to GitLab Merge the branch and push the changes to GitLab
%pre.dark %pre.dark
:preserve :preserve
git checkout #{@merge_request.target_branch} git checkout #{@merge_request.target_branch}
......
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