-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlesson_2_reflection.txt
43 lines (36 loc) · 2.1 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
33
34
35
36
37
38
39
40
41
42
43
What happens when you initialize a repository? Why do you need to do it?
When you init a repository, git creates a hidden '.git' folder in the directory.
One needs to add the untracked files using 'git add'.
How is the staging area different from the working directory and the repository?
What value do you think it offers?
Working directory cannot store different versions of the changed files, whereas
staging area can. Staging area help gather multiple files which may be part of
single logical change. Hence, putting files in staging area tracks the changes
and separates them from the files which don't need to be tracked in the working
directory.
How can you use the staging area to make sure you have one commit per logical
change?
You just add modified files which are related to single logical change and then
commit them.
What are some situations when branches would be helpful in keeping your history
organized? How would branches help?
Branches would help you separate experimental features and changes to the working
code. One can create a new branch for trying out new things. Also branching can
help work on multiple versions of the project. For example, a multilingual project.
How do the diagrams help you visualize the branch structure?
Sometimes you can end up on a commit which is detached from the 'HEAD' branch
and visualizing it showed how we can quickly identify any reachability issues.
We can then decide to commit and create a new branch so we can reach there.
What is the result of merging two branches together? Why do we represent it in
the diagram the way we do?
When two branches are merged, the changes are automatically merged in the same
file. Also a new commit is created and becomes the new tip of the branch. The
diagram shows that.
What are the pros and cons of Git’s automatic merging vs. always doing merges
manually?
Pros:
- Most of the time automatic merging will help save the time.
- Manual intervention help choose the best outcome
Cons:
- Need to interact with another developer(s) to resolve the merging conflict,
which may consume time.