-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathsession-40.txt
78 lines (55 loc) · 1.91 KB
/
session-40.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
imp file --> duplicate the file
do the changes
review the changes
test the file
if good, then change in main file
Git --> Single source of truth
CICD
------
Single paper --> write everything in single paper from all
Multiple papers --> finally colloborate imp points into one paper
Colloboration
Branching
-----------
main --> points to Production, direct changes are not at allowed.
through some review process
main --> feature branch
do changes in feature branch --> get reviews --> run some tests --> scan the code
feature --> main
everyone should create one branch for any change...
4bd656fd136438832b47ed66a211797afc53b3fb --> SHA Code --> 40 chars
key --> value
4bd656fd136438832b47ed66a211797afc53b3fb --> current code in the workspace
echo "Hello World" | git hash-object --stdin --> prints sha code on the screen
git cat-file <commit id> -p --> print the info about sha code
git checkout -b --> create new branch and change the workspace into new branch
Merge
-------
Merge
rebase
Merging
---------
create another branch
do the changes in that branch
raise PR
get the approval
then merge it
merge gives us a new merge which has 2 parents, we can clearly see the history
Rebase
---------
rebase --> change the base
no extra commit
commit id are changed
no history is preserved, it is rewritten as if it is done in main branch
looks clean, linear history
single branch --> multiple persons are working --> prefer merge
if you want to keep the history --> prefer merge
blindly go for merge, if you are not sure
single branch --> single person --> prefer rebase
if you dont want history --> prefer rebase
if you want clean structure --> prefer rebase
conflicts
----------------
if git findsout 2 different content in the same line, it cant take decission. people who wrote the code should sit together and resolve conflict
if main branch is moved forward
another branch is trying to merge the changes, then conflict will come