-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlab_012.html
More file actions
77 lines (72 loc) · 2.78 KB
/
lab_012.html
File metadata and controls
77 lines (72 loc) · 2.78 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<!doctype html>
<html lang="en">
<head>
<title>
Lab 12 - Staging Changes
</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="12">
<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 12</em>
Staging Changes
</h1>
<h2>Goals</h2>
<ul>
<li>Learn how to stage changes for later commits</li>
</ul>
<h2>Add Changes to Staging Area</h2>
<p>Use the following command to move the modified files to the staging area!
Then check the status again.</p>
<h3><b>Execute</b></h3>
<pre class="command-line" data-prompt="$"><code class="language-git">git add README.md</code></pre>
<pre class="command-line" data-prompt="$"><code class="language-git">git status</code></pre>
<h3><b>Output</b></h3>
<pre class="command-line" data-prompt="$" data-filter-output="(out)"><code class="language-git">git status
(out)On branch main
(out)Changes to be committed:
(out) (use "git restore --staged <file>..." to unstage)
(out) modified: README.md
(out)</code></pre>
<p>Similar to tracking a file, you've staged the file to the staging area. <code>Git</code>
now knows about your changes, but it's not <em>permanently</em> saved to the Git repository yet.
The next commit will include <em>only</em> the staged changes.</p>
<p>If you decide you <em>don't</em> want to commit that change after all, the status command reminds you that
the <code class="language-git">git restore</code> command can be used to unstage that change.</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>