-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlesson_2_reflection_prompts.txt
54 lines (40 loc) · 2.77 KB
/
lesson_2_reflection_prompts.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
What happens when you initialize a repository? Why do you need to do it?
A .git metadata file appears. This is necessary to tell Git that we will want
to use this directory for version control in the future.
How is the staging area different from the working directory and the repository?
What value do you think it offers?
The staging area holds files which are about to be commited, unlike the working
directory which holds files that cannot be directly commited. The repository holds
files which were previously commited.
The staging area allows one to gradually build a logical unit consisting of interconnected
files which the user would like to commit.
How can you use the staging area to make sure you have one commit per logical
change?
Add all files which correspond to a single logical change into the staging area
and then commit them. This can be done multiple times until all logical changes
were comitted.
What are some situations when branches would be helpful in keeping your history
organized? How would branches help?
1. When you would like to create a substantially different version of your program, that
has its own timeline of commits, you should branch.
2. When you would like to have a development/experimental code that is not necessarily
stable and simultaneously - a stable version of your code (which does not contain all
the latest and greatest updates), you should branch.
With branches, the hisroty of commits is arranged into a tree, each branch of which has its
own, independent linetime...
How do the diagrams help you visualize the branch structure?
The diagram allow us to trace back all the commits that are reachable from a certain branch.
Those commits are the history of development for the code in this branch. The diagram is an intuitive
way to understand all that is happening currently in a certain coding project.
What is the result of merging two branches together? Why do we represent it in
the diagram the way we do?
Branching two branches together results in a new commit which has two parent commits (the heads of the two
branches) + advancing the branch label of the "receiving" branch to the new commit. In the diagram,
a merge is an intersection where the two branches meet. This is because the branching commit has a single parent
at the head of each branch prior to the commit...
What are the pros and cons of Git’s automatic merging vs. always doing merges
manually?
Automatic merging is done without involving the user, thus - it saves time and effort.
Manual merging involves the user where the same area in the code has been touched by
both branches. The advantage of this is that instead of guessing (and possibly getting
it wrong), the best way to merge those modification is to involve the user in the process.