-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlesson_2_reflections.txt
38 lines (24 loc) · 2.03 KB
/
lesson_2_reflections.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
1-What happens when you initialize a repository? Why do you need to do it?
1. Git created a .git directory for me. and I was on my master branch now. in one words, I initialized my repo now.
2.I need to creat a repo for my project, so I can track it.
2-How is the staging area different from the working directory and the repository? What value do you think it offers?
Stageing area keep only part of all files in the working directory in tracking.
That means we can obtain fine-grained control over my project. and keep some files out of tracking.
3-How can you use the staging area to make sure you have one commit per logical change?
use git diff to compare the working directory and staging area. did not commit until we confirm that's what we need.
4-What are some situations when branches would be helpful in keeping your history organized? How would branches help?
for situations including but not limiting: expriment some new feature or creating a foreign version.
new branch could follow the logic line itself without disrupt the master branch.
if the new branch succeed, then we can merge it with the master branch.
to sum up, git branch make our develop more logical and easy.
5-How do the diagrams help you visualize the branch structure?
Impressive! developing is kind of like building a tree. sometimes we want to try something new, then we branch it.
With the diagram I understanded how my project are organized.
6-What is the result of merging two branches together? Why do we represent it in the diagram the way we do?
1.create a new commit node. give it a new ID.
2.this node has 2 previous node. one is HEAD branch1 and the other is HEAD of branch2,both HEAD means the HEAD before merging.
3.in the diagram we found that 2 branch diverged at the some point and merged at this point.
7-What are the pros and cons of Git’s automatic merging vs. always doing merges manually?
Always automaticmerging:
pros: fast and efficiently
cons: when more than 2 branches modified same lines,automatic merging become unpredictable.