-
Notifications
You must be signed in to change notification settings - Fork 15
/
chermaine-notes.txt
73 lines (51 loc) · 1.48 KB
/
chermaine-notes.txt
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
Git storage
Git time travelling
Git social coding
==== Section 1: Command Line
=============================
mkdir [directory-name]
make new folder with name [directory-name]
ls
displays a list of files and folders in the current folder
cd [directory-name]
go into [directory-name]
touch [file.extension]
creates a new file with name [file extension]
cat [filename]
displays contents in the file
pwd
displays the current working directory
ctrl l
clear everything in current working directory
===== Section 2: Basic Git
==========================
By default, everything is in working directory (cardboard box). To shift file to staging area (wooden box) and then to repository (metal box):
git init
intialize a new git repository
git status
tells us the status of our working directory
red = changes are in cardboard box
green = changes are in wooden box
working tree clean = changes are in repository (metal box)
git add
tells git to start tracking a file
(move stuff to the wooden box)
git commit -m "message"
commit changes to the repository
(move stuff from wooden box to metal box)
git log
shows us all the commits that were made
git log --oneline
shows us all the commits in oneline
====== Git Summary
==================
Commit:
move from staging area to repository
Basic git workflow:
1. Change
2. Stage (Add)
3. Finalize (Commit)
We have committed twice. = We made changes twice.
We made two commits. = We made two changes.
===== Section 3
================