-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathdouglas-notes2.txt
66 lines (44 loc) · 1.17 KB
/
douglas-notes2.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
==== Section 1: Command Line
mkdir [director-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 the contents of the file
pwd
Print working directory
git init
Initialises the directory to begin being tracked by git
git status
Shows tracked and untracked files
git add [filename]
Temporary staging area
git commit [filename]
Permanent storage
git diff
shows the differences between whats in staging and directory
git log [--oneline]
shows our previous commits
git log --all
shows all changes ever.
the normal git log only shows the changes before the current branch
==== Git Summary
=======
Commit:
Save changes to the repository
Basic git workflow:
1. Change
2. Stage (Add)
3. Finalize (Commit)
==== Branches
==========
git branch
list branches in the repo
git branch [branch-name]
create a new branch with name [branc-name] from current branch
git checkout [branch-name]
switch to an existing branch [branch-name]