56 lines
2.6 KiB
Text
56 lines
2.6 KiB
Text
#modal_merge_info.modal{ tabindex: '-1' }
|
|
.modal-dialog.modal-lg
|
|
.modal-content
|
|
.modal-header
|
|
%h3.modal-title Check out, review, and merge locally
|
|
%button.close{ type: "button", "data-dismiss": "modal", "aria-label" => _('Close') }
|
|
%span{ "aria-hidden": true } ×
|
|
.modal-body
|
|
%p
|
|
%strong Step 1.
|
|
Fetch and check out the branch for this merge request
|
|
= clipboard_button(target: "pre#merge-info-1", title: _("Copy commands"))
|
|
%pre.dark#merge-info-1
|
|
- if @merge_request.for_fork?
|
|
-# All repo/branch refs have been quoted to allow support for special characters (such as #my-branch)
|
|
:preserve
|
|
git fetch "#{h default_url_to_repo(@merge_request.source_project)}" "#{h @merge_request.source_branch}"
|
|
git checkout -b "#{h @merge_request.source_project_path}-#{h @merge_request.source_branch}" FETCH_HEAD
|
|
- else
|
|
:preserve
|
|
git fetch origin
|
|
git checkout -b "#{h @merge_request.source_branch}" "origin/#{h @merge_request.source_branch}"
|
|
%p
|
|
%strong Step 2.
|
|
Review the changes locally
|
|
|
|
%p
|
|
%strong Step 3.
|
|
Merge the branch and fix any conflicts that come up
|
|
= clipboard_button(target: "pre#merge-info-3", title: _("Copy commands"))
|
|
%pre.dark#merge-info-3
|
|
- if @merge_request.for_fork?
|
|
:preserve
|
|
git fetch origin
|
|
git checkout "#{h @merge_request.target_branch}"
|
|
git merge --no-ff "#{h @merge_request.source_project_path}-#{h @merge_request.source_branch}"
|
|
- else
|
|
:preserve
|
|
git fetch origin
|
|
git checkout "#{h @merge_request.target_branch}"
|
|
git merge --no-ff "#{h @merge_request.source_branch}"
|
|
%p
|
|
%strong Step 4.
|
|
Push the result of the merge to GitLab
|
|
= clipboard_button(target: "pre#merge-info-4", title: _("Copy commands"))
|
|
%pre.dark#merge-info-4
|
|
:preserve
|
|
git push origin "#{h @merge_request.target_branch}"
|
|
- unless @merge_request.can_be_merged_by?(current_user)
|
|
%p
|
|
Note that pushing to GitLab requires write access to this repository.
|
|
%p
|
|
%strong Tip:
|
|
= succeed '.' do
|
|
You can also checkout merge requests locally by
|
|
= link_to 'following these guidelines', help_page_path('user/project/merge_requests/reviewing_and_managing_merge_requests.md', anchor: "checkout-merge-requests-locally-through-the-head-ref"), target: '_blank', rel: 'noopener noreferrer'
|