forked from varunpatro/git-101-usp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
taha-notes.txt
82 lines (60 loc) · 1.51 KB
/
taha-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
74
75
76
77
78
79
80
81
82
==== Section 1: Command Line
===========
mkdir (directory-name) {
make a 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 (filename) {
creates a file with (file-name) if it was not already createdcat
}
cat (filename) {
displays contents of the file
}
pwd {
shows the directory youre currently working in
}
git config
==== Section 2: basic git commands
==================
git status
tells us the status of the working directory
no red = no cupboard box
(what is not in the saving area)
no gree = no wooden box
(what is not in the working area)
git add
tells git to start tracking a file
(move to wooden box)
git commit -m "MESSAGE"
commit changes to the repository
(move stuff from wooden to metal box)
git diff
shows is what has chamged between our working directory, staging area repository
git log
shows the commit history
git log --oneline
shows all the commits in one line
==== Git Summary
==============
Commit:
<Explain>
*Finalise the changes in the file to the repository?*
Basic git workflow:
1. Edit/Change
2. Stage (Add)
3. Finalise (Commit)
==== Section 3: Time travelling and multiverse
==============
git checkout (commut-id)
switches workspace to the version at that commit-id
==== Section 4: Social Coding
===============
git clone
clones an online repository onto disk
git push
pushes new version to the online repository