-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathgit.html
More file actions
54 lines (53 loc) · 2.53 KB
/
git.html
File metadata and controls
54 lines (53 loc) · 2.53 KB
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
{% assign url = include.git.url %}
{% unless url %}
{% assign github-url = include.github.url %}
{% unless github-url %}{% assign github-url = 'https://github.com/' | append: include.github.name %}{% endunless %}
{% assign url = github-url | replace: 'https://', 'git://' | append: '.git' %}
{% endunless %}
{% assign commands = include.git.command %}
{% unless commands.first or include.git.command == nil %}{% assign commands = '' | split: '' | push: include.git.command %}{% endunless %}
<p class="alert alert-info">
Make sure you have
<a href="https://git-scm.com/">git</a>
{% if include.git.install-composer-dependencies == true %}
and <a href="{{ site.projects | where: 'title', 'Composer' | map: 'url' | first | absolute_url }}">Composer</a>
{% endif %}
{% if include.dependencies != nil && include.dependencies != empty && include.dependencies.first != nil %}
{% assign list = include.dependencies | join: ', ' %}
{% if list != '' %}
and all dependencies {{ list }}
{% endif %}
{% endif %}
installed.
</p>
<div class="card mb-3">
<div class="card-body">
Git clone the repository:
<br/>
<code class="highlighter-rouge">git clone {{ url }}</code>
<br/>Change into the new directory:
<br/><code class="highlighter-rouge">cd {{ url | split: '/' | last | replace: '.git', '' }}</code>
{% if include.git.update-submodules == true %}
<br/>Update the submodules:
<br/><code class="highlighter-rouge">git submodule update --init</code>
{% endif %}
{% if include.git.install-composer-dependencies == true %}
<br/>Install the project dependencies:
<br/><code class="highlighter-rouge">composer install</code>
{% endif %}
{% if include.git.further-instructions %}
{% for item in include.git.further-instructions %}
<br/>{{ item[0] }}:
<br/><code class="highlighter-rouge">{{ item[1] }}</code>
{% endfor %}
{% endif %}
{% if commands %}
<br/>Run it:
{% for item in commands %}
{% assign type = item[0] %}
{% assign command = item[1] %}{% unless command != nil %}{% assign command = item %}{% endunless %}
<br/><code class="highlighter-rouge">{{ command }}</code> {% if type %}({{ type }}){% endif %}
{% endfor %}
{% endif %}
</div>
</div>