2018-11-08 19:23:39 +05:30
|
|
|
- @content_class = "limit-container-width" unless fluid_layout
|
2021-06-08 01:23:25 +05:30
|
|
|
- default_branch_name = @project.default_branch_or_main
|
2022-05-07 20:08:51 +05:30
|
|
|
- escaped_default_branch_name = default_branch_name.shellescape
|
2021-02-22 17:27:13 +05:30
|
|
|
- @skip_current_level_breadcrumb = true
|
2016-01-19 16:12:03 +05:30
|
|
|
|
2022-07-23 23:45:48 +05:30
|
|
|
= render_if_exists 'projects/free_user_cap_alert', project: @project
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
= render partial: 'flash_messages', locals: { project: @project }
|
2022-07-23 23:45:48 +05:30
|
|
|
= render 'clusters_deprecation_alert'
|
2015-04-26 12:48:37 +05:30
|
|
|
|
2020-11-24 15:15:51 +05:30
|
|
|
= render "home_panel"
|
2021-04-29 21:17:54 +05:30
|
|
|
= render "archived_notice", project: @project
|
2014-09-02 18:07:02 +05:30
|
|
|
|
2021-10-27 15:23:28 +05:30
|
|
|
= render "invite_members_empty_project" if can_admin_project_member?(@project)
|
2021-02-22 17:27:13 +05:30
|
|
|
|
2020-11-24 15:15:51 +05:30
|
|
|
%h4.gl-mt-0.gl-mb-3
|
|
|
|
= _('The repository for this project is empty')
|
2018-03-27 19:54:05 +05:30
|
|
|
|
2020-11-24 15:15:51 +05:30
|
|
|
- if @project.can_current_user_push_code?
|
2021-01-03 14:25:43 +05:30
|
|
|
%p
|
2020-11-24 15:15:51 +05:30
|
|
|
= _('You can get started by cloning the repository or start adding files to it with one of the following options.')
|
2018-03-17 18:26:18 +05:30
|
|
|
|
2020-11-24 15:15:51 +05:30
|
|
|
.project-buttons.qa-quick-actions
|
2022-08-13 15:12:31 +05:30
|
|
|
.project-clone-holder.d-block.d-md-none.gl-mt-3.gl-mr-3
|
2020-11-24 15:15:51 +05:30
|
|
|
= render "shared/mobile_clone_panel"
|
2020-03-13 15:44:24 +05:30
|
|
|
|
2022-08-13 15:12:31 +05:30
|
|
|
.project-clone-holder.d-none.d-md-inline-block.gl-mb-3.gl-mr-3.float-left
|
2020-11-24 15:15:51 +05:30
|
|
|
= render "projects/buttons/clone"
|
2021-01-03 14:25:43 +05:30
|
|
|
= render 'stat_anchor_list', anchors: @project.empty_repo_statistics_buttons, project_buttons: true
|
2019-05-30 16:15:17 +05:30
|
|
|
|
2020-11-24 15:15:51 +05:30
|
|
|
- if can?(current_user, :push_code, @project)
|
2021-01-03 14:25:43 +05:30
|
|
|
.empty-wrapper.gl-mt-4
|
2020-11-24 15:15:51 +05:30
|
|
|
%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
|
2022-05-07 20:08:51 +05:30
|
|
|
%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}"
|
2014-09-02 18:07:02 +05:30
|
|
|
|
2022-05-07 20:08:51 +05:30
|
|
|
%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}
|
|
|
|
git switch -c #{h escaped_default_branch_name}
|
|
|
|
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 #{h escaped_default_branch_name }
|
2014-09-02 18:07:02 +05:30
|
|
|
|
2022-05-07 20:08:51 +05:30
|
|
|
%h5= _('Push an existing folder')
|
|
|
|
%pre.bg-light
|
|
|
|
:preserve
|
|
|
|
cd existing_folder
|
|
|
|
git init --initial-branch=#{h escaped_default_branch_name}
|
|
|
|
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 #{h escaped_default_branch_name }
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2022-05-07 20:08:51 +05:30
|
|
|
%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
|