-
Notifications
You must be signed in to change notification settings - Fork 0
/
lesson_2_reflections.txt
26 lines (20 loc) · 1.85 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
What happens when you initialize a repository? Why do you need to do it?
A .git file is created.
But no commit is made automatically.
How is the staging area different from the working directory and the repository? What value do you think it offers?
Staging area is an intermediate status between the working directory and the repository. It allows us to make commit to the files that we want to, and not necessarily to everything at once.
How can you use the staging area to make sure you have one commit per logical change?
Is is possible to compare the modifications in the staging area and the working directory by using git diff (no argument).
And it is possible to double check by comparing the staging area and the latest commit by using git diff --staged.
When running those lines, it is possible to check thay only one logical change has been made.
What are some situations when branches would be helpful in keeping your history organized? How would branches help?
Branches are helpful when developing a new feature we are not sure when we want to include.
Or when several people are working on a project, they could use branches in order not to interfere with each other until they are satisfied with the result.
How do the diagrams help you visualize the branch structure?
Helps to see what feature is on what branch, and what is not.
What is the result of merging two branches together? Why do we represent it in the diagram the way we do?
The result is a merged branch. Both parents are accessible within the same branch.
We represent the diagram this way to see the old branch, and the fact that if we checkout to one branch, we may not have all the changes.
What are the pros and cons of Git’s automatic merging vs. always doing merges manually?
Automatical merging make you gain time.
This could lead to conflicts, but git pinpoints them so you can easily find them.