-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlesson_2_reflections.txt
44 lines (38 loc) · 2.19 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
Q. What happens when you initialize a repository? Why do you need to do it?
A. Git creates an hidden directory containing all metadata of my repository.
I need to do it in order to create a new git repository of the files in
the current directory and thus enabling version control of the project.
Q. How is the staging area different from the working directory and the
repository? What value do you think it offers?
A. Files in working directory can't be committed unless thery are moved into
stagin area.
Files in staging area can be commited to become part of the repo, or can
be reverted to working directory files.
Repository contains all commited files.
Stagin area allows to have total control over the commits. In fact
one can add to staging area only a subset of the file that have changed.
Q. How can you use the staging area to make sure you have one commit per
logical change?
A. I can add to staging area (and then commit) only the files related to
the logical change I want to commit.
Q. What are some situations when branches would be helpful in keeping your
history organized? How would branches help?
A. Branches are helpful when coding experimental features, fixing bugs,
adding new features, coding new different version of the program...
Useful when you're switching context and when you're collaborating with
other people but also with yourself :)
Q. How do the diagrams help you visualize the branch structure?
A. I can see where new branches started and eventually has been merged.
I can also see to which branches the commits belong to.
Q. What is the result of merging two branches together?
Why do we represent it in the diagram the way we do?
A. Changes from branch A are merged with changes from branch B.
The result is a single merged branch.
Changes are added or removed in the merged branch comparing A
and B with the original files. Conflicts may happen!
We represent the merge making the two lines converging into one.
A. What are the pros and cons of s automatic merging vs. always doing
merges manually?
Q. PROS: faster if no conflicts happen.
CONS: if conflict happens you need to resolve it and maybe it can't be
very simple.