-
Notifications
You must be signed in to change notification settings - Fork 0
/
lab_010.html
116 lines (111 loc) · 5.14 KB
/
lab_010.html
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<!DOCTYPE html>
<html lang="en">
<head>
<title>
Lab 10 - Tracking Files
</title>
<meta charset="UTF-8" />
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible" />
<meta "="" content=" width=device-width, initial-scale=1.0" name="viewport" />
<meta content="A guided tour through the fundamentals of Git, HTML, & CSS" name=" description" />
<meta content="#0000ff" name="theme-color" />
<link href="manifest.json" rel="manifest" />
<link href="css/reset.css" media="screen" rel="stylesheet" />
<link href="css/screen.css" media="screen" rel="stylesheet" />
<link href="css/prism.css" rel="stylesheet" />
</head>
<body data-lab-id="10">
<a class="skip-to-content" href="#content" tabindex="1">
Skip to content
</a>
<main class="layout">
<nav id="index">
<p class="link-home">
<a href="index.html">
<span>Hack4Impact Starter Pack</span>
</a>
</p>
<button class="link-menu">
Menu
</button>
<nav tabindex="0">
<ol>
</ol>
</nav>
</nav>
<div id="content" tabindex="-1">
<h1 class="lab_title">
<em>Lab 10</em>
Tracking Files
</h1>
<h2>Goals</h2>
<ul>
<li>Learn how to track a file to the <code>Git</code> repository</li>
</ul>
<h2>Add File to Track</h2>
<p>Thankfully, there's a helpful suggestion about what we can do! To begin tracking this file in our
<code>Git</code> repository, run the following command:</p>
<h3><b>Execute</b></h3>
<pre class="command-line git" data-prompt="$"><code class="language-git">git add README.md</code></pre>
<p>Now run, <code>git status</code> again to check the state of the working directory and repository.</p>
<h3><b>Execute</b></h3>
<pre class="command-line git" data-prompt="$"><code class="language-git">git status</code></pre>
<h3><b>Output</b></h3>
<pre class="command-line git" data-prompt="$" data-filter-output="(out)"><code class="language-git">git status
(out)On branch main
(out)
(out)No commits yet
(out)
(out)Changes to be committed:
(out) (use "git rm --cached <file>..." to unstage)
(out) new file: README.md
(out)</code></pre>
<p class="note"><strong>Note:</strong> When you create new files, you should track them as soon as possible. If you
decide to add all files in the current directory to a commit you can use <code class="language-git">git add .</code> (period).</p>
<p>If you remember Lab 7, the file is now added to the staging area. From there, the next step is...</p>
<h2>Commit File to Repository</h2>
<p>To save the state of this file, we'll commit it to our <code>Git</code> repository! Every commit also
requires a message that describes the purpose of the commit, which we can set with the <code>-m</code> parameter.</p>
<h3><b>Execute</b></h3>
<pre class="command-line git" data-prompt="$"><code class="language-git">git commit -m "feat: add README.md"</code></pre>
<h3><b>Output</b></h3>
<pre class="command-line git" data-prompt="$" data-filter-output="(out)"><code class="language-git">git commit -m "feat: add README.md"
(out)[main (root-commit) f1et44a7] feat: add README.md
(out) 1 file changed, 0 insertions(+), 0 deletions(-)
(out) create mode 100644 README.md
(out)</code></pre>
<p class="note"><strong>Note:</strong> We will be using conventional commits. The format is <em><feat or fix>: <commit message under 50 words></em>.
Commit messages should be clear and concise in the present tense.</p>
<h2>Status Check</h2>
<h3><b>Execute</b></h3>
<pre class="command-line git" data-prompt="$"><code class="language-git">git status</code></pre>
<h3><b>Output</b></h3>
<pre class="command-line git" data-prompt="$" data-filter-output="(out)"><code class="language-git">git status
(out)On branch main
(out)nothing to commit, working tree clean
(out)</code></pre>
<p>You should see this message which means the state of your working directory matches the latest state committed to the repository!</p>
<h2>More Files to Track</h2>
<p>Create the following files, follow the same steps, and track them one at a time. For each file, the commit message should follow
the format of <code class="language-git">"feat: add <file name>"</code>.</p>
<ul>
<li>styles.css</li>
<li>blog.html</li>
<li>contact.html</li>
<li>index.html</li>
<li>portfolio.html</li>
<li>resume.html</li>
</ul>
<p>Alternatively, you can make one commit with all the files. In which case, the commit message should be
<code class="language-git">"feat: <describe commit in 50 words>"</code>.</p>
<p class="note"><strong>Hint:</strong> You can stage more than one file before you commit them.</p>
</div>
</main>
<script src="js/ui.js" type="text/javascript"></script>
<script src="js/prism.js" type="text/javascript"></script>
<script type="module">
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs';
mermaid.initialize({startOnLoad: true, theme: "base"});
</script>
</body>
</html>