-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathgit-notes.txt
57 lines (37 loc) · 1.03 KB
/
git-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
====== BASIC STUFF ======
mkdir [directory-name]
make new folder with name [directory-name]
ls
list: displays a list of files and folders in the current folder
cd [directory-name]
change directory: go into [directory-name]
touch [file.extension]
creates a new file with name [file.extension]
cat [filename]
displays the contents of the file
pwd
print working directory: displays the current working directory
ctrl-L: to clear the screen
====== GIT ======
git init
initialise a new git repository
git status
tells us the status of our working directory
git add
tells git to start tracking af ile
(move stuff to the wooden box)
git commit -m "MESSAGE"
commit changes to the repository
(move stuff from wooden box to metal box)
git diff
shows us what has changed between our working directory, stagin area and repo
git log
shows us all the commits that were made
git log --oneline
shows us all the commits in one line
====== GIT summary =======
Commit:
Basic git workflow:
1. Change
2. Stage (Add)
3. Finalist (Commit)