-
Notifications
You must be signed in to change notification settings - Fork 512
/
commit_to_it_problem.html
46 lines (46 loc) · 2.13 KB
/
commit_to_it_problem.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
<p> Create a file in your new repository, add something to that file and
commit those changes to Git.</p>
<hr>
<p> Now that you've got a repository started, add a file to it. </p>
<p> {bold}{cyan}
New File{/bold}
--------{/cyan}</p>
<p> Open a text editor. Now write a couple of lines of text, perhaps
describe the tastiest sandwich you can imagine, and save the
file as <code>readme.md</code> in the folder you created in the last lesson.</p>
<p> {bold}{cyan}
Check, Add and Commit Changes{/bold}
-----------------------------{/cyan}</p>
<p> Next check the {bold}status{/bold} of your repository. Below in this terminal,
you should still be within the new folder you created. See if there
are changes listed:</p>
<p> $ git status</p>
<p> Then {bold}add{/bold} the file you just created to the files you'd
like to {bold}commit{/bold} (aka save) to change. </p>
<p> $ git add readme.md</p>
<p> Finally, {bold}commit{/bold} those changes to the repository's history with a
short description of the updates. See the command hints below!</p>
<p> $ git commit -m "your commit message"</p>
<p> {bold}{cyan}
Make More Changes{/bold}
-----------------------------{/cyan}</p>
<p> Now add another line to <code>readme.md</code>, perhaps a title, and save.</p>
<p> In terminal, you can view the {bold}diff{/bold}erence between the
file now and how it was at your last commit. </p>
<p> $ git diff</p>
<p> Now with what you just learned above, commit this latest change.</p>
<p> When all changes are committed, run <code>git-it verify</code>.</p>
<p> {cyan}</p>
<h2 id="-git-tips-"> <strong>GIT TIPS</strong></h2>
<p> {bold}Check status of changes to a repository{/bold}</p>
<p> $ git status</p>
<p> {bold}View changes to files{/bold}</p>
<p> $ git diff</p>
<p> {bold}Add a file's changes to be committed{/bold}</p>
<p> $ git add <FILENAME></p>
<p> {bold}To add all files' changes{/bold}</p>
<p> $ git add .</p>
<p> {bold}To commit (aka save) the changes you've added with a short
message describing the changes{/bold}</p>
<p> $ git commit -m "your commit message"{/cyan}</p>
<hr>