-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlesson_2_reflection.txt
32 lines (19 loc) · 1.9 KB
/
lesson_2_reflection.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
What happens when you initialize a repository? Why do you need to do it?
A hidden directory ".git" is created. All the meta-data related to
the version control function will be stored in the .git directory.
How is the staging area different from the working directory and the r-
pository? What value do you think it offers?
It is the middle area between the working directory and the reposi-tory. It can allow you put multiple files you want to commit their
changes together in the staging area before committed.
How can you use the staging area to make sure you have one commit per
logical change?
I can use git add to add the logical change related file to the staging area, and then use git diff to compare the files between the working directory and the staging area to find out the change I have made on the file. If it has already completed a logical change, I can use git commit to commit that change.
What are some situations when branches would be helpful in keeping your history organized? How would branches help?
When I need to add some experimental features to the program or make another version in different languages. I can esaily switch between different branches through git checkout branchname. Doing something different. Branch helps in collaborating.
How do the diagrams help you visualize the branch structure?
You can get the mind of how many branches there are, where the branches are located, and identify the parent of each commit.
What is the result of merging two branches together? Why do we represent it in the diagram the way we do?
The commits of two branches are merged into one branch sorted in time sequence. Respresent it in diagram could makes the logic much clearer.
What are the pros and cons of Git's automatic merging vs. always doing merges manually?
Pros: easily handle the common parts which are the most parts of the file;
Cons: still needs to handle the conflicts by hand.