BigW Consortium Gitlab

_how_to_merge.html.haml 2.44 KB
Newer Older
1
%div#modal_merge_info.modal
Dmitriy Zaporozhets committed
2 3 4 5
  .modal-dialog
    .modal-content
      .modal-header
        %a.close{href: "#", "data-dismiss" => "modal"} ×
6
        %h3 Check out, review, and merge locally
Dmitriy Zaporozhets committed
7
      .modal-body
8
        %p
9
          %strong Step 1.
10
          Fetch and check out the branch for this merge request
11 12
        = clipboard_button(clipboard_target: 'pre#merge-info-1')
        %pre.dark#merge-info-1
13
          - if @merge_request.for_fork?
Dmitriy Zaporozhets committed
14
            :preserve
15 16
              git fetch #{h @merge_request.source_project.http_url_to_repo} #{h @merge_request.source_branch}
              git checkout -b #{h @merge_request.source_project_path}-#{h @merge_request.source_branch} FETCH_HEAD
17
          - else
18 19
            :preserve
              git fetch origin
20
              git checkout -b #{h @merge_request.source_branch} origin/#{h @merge_request.source_branch}
21 22 23 24 25 26 27
        %p
          %strong Step 2.
          Review the changes locally

        %p
          %strong Step 3.
          Merge the branch and fix any conflicts that come up
28 29
        = clipboard_button(clipboard_target: 'pre#merge-info-3')
        %pre.dark#merge-info-3
30 31
          - if @merge_request.for_fork?
            :preserve
32 33
              git checkout #{h @merge_request.target_branch}
              git merge --no-ff #{h @merge_request.source_project_path}-#{h @merge_request.source_branch}
34
          - else
Dmitriy Zaporozhets committed
35
            :preserve
36 37
              git checkout #{h @merge_request.target_branch}
              git merge --no-ff #{h @merge_request.source_branch}
38 39 40
        %p
          %strong Step 4.
          Push the result of the merge to GitLab
41 42
        = clipboard_button(clipboard_target: 'pre#merge-info-4')
        %pre.dark#merge-info-4
43
          :preserve
44
            git push origin #{h @merge_request.target_branch}
45 46 47
        - unless @merge_request.can_be_merged_by?(current_user)
          %p
            Note that pushing to GitLab requires write access to this repository.
48 49 50 51
        %p
          %strong Tip:
          You can also checkout merge requests locally by
          %a{href: 'https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/workflow/merge_requests.md#checkout-merge-requests-locally', target: '_blank'} following these guidelines
52 53 54 55 56 57 58 59

:javascript
  $(function(){
    var modal = $('#modal_merge_info').modal({modal: true, show:false});
    $('.how_to_merge_link').bind("click", function(){
      modal.show();
    });
    $('.modal-header .close').bind("click", function(){
60
      modal.hide();
61 62
    })
  })