-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathcheryl-notes.txt
72 lines (50 loc) · 1.49 KB
/
cheryl-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
Syntax
working directory -> staging area -> repo
=======================================
mkdir [directory_name]
make new folder with name [directory_name]
rm [filename]
deletes relevant file altogether
ls
displays a list of files and folders in current folder
cd [directory_name]
go into [directory_name]
touch [file.extension]
creates a new file with name [file.extension]
cat [filename]
displays all content of file
pwd
displays the current working directory
git init
initialises a new git repository
git add [file.extension]
moves file from working directory to staging area
tells git to start tracking a file
git add .
moves all files from working directory to staging area
git add *.extension
moves every file with .extension (eg. *.txt adds a1.txt and a2.txt) from working directory to staging area
git status
shows whether files are tracked or not within current folder
tells us status of working directory
git commit
get out by using esc + ':q!'
git commit -m "message"
commits changes to the repository
moves file from staging area to repo
git diff
shows changes between working directory and staging area
git log --oneline
shows history on one line. it's prettier!!!!!
=== Git Summary
===============
Commit:
Basic git workflow:
1. Change
2. Stage (Add)
3. Finalize (Commit)
=== Section 3: Time travelling and the multiverse
===============
git checkout [commit-id]
switches workspace to the version at that commit-id
(use git checkout master when commiting. don't panic.)