-
Notifications
You must be signed in to change notification settings - Fork 0
/
lesson_2_reflections.txt
20 lines (14 loc) · 1.82 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
What happens when you initialize a repository? Why do you need to do it?
git init creates an empty repository ready for new files to be added. We need to initialize a repository in order to track changes on our files.
How is the staging area different from the working directory and the repository? What value do you think it offers?
Staging area is a place where you put the files that you want to keep track of before commiting them to the repository. It is like a buffer area between the working directory and the repository.
How can you use the staging area to make sure you have one commit per logical change?
We can add a changed file to the staging area and get a diff to see the changes made. This way we can make sure we are making one commit per logical change.
What are some situations when branches would be helpful in keeping your history organized? How would branches help?
Whenever we want to make a new version of our code we can use branches. We can also use branches to develop a new feature in the code.
How do the diagrams help you visualize the branch structure?
By visualizing the branch structure we can see the reachability of each commit from the current branch. We can also see the previous commits all at once.
What is the result of merging two branches together? Why do we represent it in the diagram the way we do?
The result of merging two branches together combines all the changes made in both branches into a new commit and moves the head of current branch to this commit.
What are the pros and cons of Git’s automatic merging vs. always doing merges manually?
Merge automatically detect the conflicts and shows us the differences between branches. We can resolve the conflicts using the signs that git put in the conflicting file or files. After resolving the conflict issue, we can commit again to write the changes.