/
lesson-2-reflections.txt
58 lines (33 loc) · 1.98 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
What happens when you initialize a repository? Why do you need to do it?
When you init the git repository, a hidden folder(.git) is created where all of
the metadata regarding changes will be stored. It needs to be done so that git
will have a place for all of its information.
How is the staging area different from the working directory and the repository?
What value do you think it offers?
The staging area is an intermediary between the working directory and the
repository. It allows you to keep your working directory separated from your
commits so that you can apply commits in logical fashion.
How can you use the staging area to make sure you have one commit per logical
change?
By adding files that relate to the logical change to the staging area while
files that aren't related are left in the working directory you can make sure
your commits are based on one logical change.
What are some situations when branches would be helpful in keeping your history
rganized? How would branches help?
One situation in which branches would be helpful is if you are going to add an
experimental feature. It would help by keeping a major change separate from the
existing code.
How do diagrams help you visualize the branch structure?
Diagrams help you to see what the parent of every commit is going back to when
the branch was created. This helps you to see what commits are reachable from
eeach specific branch.
What is the result of merging two branches together? Why do we represent it in
the diagram the way we do?
Merging two branches together brings all of the commits to the same branch. I t
is represented this way to reflect that.
What are the pros and cons of Git's automatic merging vs. always doing merges
manually?
Obvious pro is that when it can merge without conflicts, it will be much faster
than manually diffing files and merging. The major con will be when a conflict
arises, it may take a while to figure out what is going on in the code before
you can complete the merge.