-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlesson_2_reflections.txt
28 lines (15 loc) · 2.66 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
What happens when you initialize a repository? Why do you need to do it?
A new .git folder was created which keeps track of the files which are in the repository.
How is the staging area different from the working directory and the repository? What value do you think it offers?
Staging area is useful when we have multiple files that are in the working directory but not in repository. It is very much possible that we want to add one file after another or change of one file is done while other is in progress and we would be adding the second file later. In this case we could add file with changes complete to staging area and then do the modification to second file to complete its work and add it to staging area when the work is complete and commit both at the same time as both of them mught be related somehow.
How can you use the staging area to make sure you have one commit per logical change?
With staging area we can have files staged here until all the files related to one logic change are not added and wait for commit to be performed. After all the changes are done and all files are added to staging area the files are commited to repository.
What are some situations when branches would be helpful in keeping your history organized? How would branches help?
When there are more than one person or more than one versions of a project required branching could help. On different version there could be different features developed and they could be mearged time to time or at the end.
How do the diagrams help you visualize the branch structure?
In the brach diagrams we can see what has changed and how much two branches differ from one another or what are different commits on each branch.
What is the result of merging two branches together? Why do we represent it in the diagram the way we do?
The mearge with contain all the changes from two branches with reference to the original files from which the two branches were created.
We represent it in the diagram to see what changes were there on different branches so that we could refer to them using proper commits.
What are the pros and cons of Git’s automatic merging vs. always doing merges manually?
For git when it is clear that the files are modified at different regions and which change to keep is obvious it is good that git auto merge is performed as it would be usually the case that people would be working on different logic and modifying different portion of a file and it would be tidious to merge these obvious changes manually. But if the same region is modified by different persons then it is good to do manual merging of the files. Git wont be knowing in this scenario which changes to keep and which to discard.