summaryrefslogtreecommitdiff
path: root/app/views/projects/empty.html.haml
blob: c9edc3c12ecc0117c2e5e6c3459f4948acb45e77 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
- @content_class = "limit-container-width" unless fluid_layout
- default_branch_name = Gitlab::CurrentSettings.default_branch_name.presence || "master"
- breadcrumb_title _("Details")
- page_title _("Details")

= render partial: 'flash_messages', locals: { project: @project }

= render "home_panel"

%h4.gl-mt-0.gl-mb-3
  = _('The repository for this project is empty')

- if @project.can_current_user_push_code?
  %p.gl-mb-0
    = _('You can get started by cloning the repository or start adding files to it with one of the following options.')

.project-buttons.qa-quick-actions
  .project-clone-holder.d-block.d-md-none.mt-2.mr-2
    = render "shared/mobile_clone_panel"

  .project-clone-holder.d-none.d-md-inline-block.mt-2.mr-2.float-left
    = render "projects/buttons/clone"
  = render 'stat_anchor_list', anchors: @project.empty_repo_statistics_buttons

- if can?(current_user, :push_code, @project)
  .empty-wrapper.gl-mt-7
    %h3#repo-command-line-instructions.page-title-empty
      = _('Command line instructions')
    %p
      = _('You can also upload existing files from your computer using the instructions below.')
    .git-empty.js-git-empty
      %fieldset
        %h5= _('Git global setup')
        %pre.bg-light
          :preserve
            git config --global user.name "#{h git_user_name}"
            git config --global user.email "#{h git_user_email}"

      %fieldset
        %h5= _('Create a new repository')
        %pre.bg-light
          :preserve
            git clone #{ content_tag(:span, default_url_to_repo, class: 'js-clone')}
            cd #{h @project.path}
            touch README.md
            git add README.md
            git commit -m "add README"
          - if @project.can_current_user_push_to_default_branch?
            %span><
              git push -u origin #{ default_branch_name }

      %fieldset
        %h5= _('Push an existing folder')
        %pre.bg-light
          :preserve
            cd existing_folder
            git init
            git remote add origin #{ content_tag(:span, default_url_to_repo, class: 'js-clone')}
            git add .
            git commit -m "Initial commit"
          - if @project.can_current_user_push_to_default_branch?
            %span><
              git push -u origin #{ default_branch_name }

      %fieldset
        %h5= _('Push an existing Git repository')
        %pre.bg-light
          :preserve
            cd existing_repo
            git remote rename origin old-origin
            git remote add origin #{ content_tag(:span, default_url_to_repo, class: 'js-clone')}
          - if @project.can_current_user_push_to_default_branch?
            %span><
              git push -u origin --all
              git push -u origin --tags