-
Notifications
You must be signed in to change notification settings - Fork 0
/
lesson_2_reclections.txt
28 lines (15 loc) · 2.3 KB
/
lesson_2_reclections.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?
By making it a git repository, you can use version control for any files you commit in that directory.
How is the staging area different from the working directory and the repository? What value do you think it offers?
The staging area is where files go that are ready to be committed. The working directory is the area where the files are edited and made changes on. The repository is the area that contains files that have been committed. The value is that version control can be tracked and viewed in the repository while the working directory is sort of the playground where one can change the code and try different things without making any commits and the staging area is where something is 'on deck' so as to confirm whether it will finally be a commit.
How can you use the staging area to make sure you have one commit per logical change?
I can use git status to check what is in the staging area and make sure that all the files are related to a single logical change.
What are some situations when branches would be helpful in keeping your history organized? How would branches help?
Branches would be helpful when trying to experiment or add new features to the code. That way, the master can stay as is but there will be freedom to make different versions of the code. Also, naming branches is useful because it can remind you of what you are working on with regard to that version.
How do the diagrams help you visualize the branch structure?
Diagrams show how branches are related and when they first emerged. Diagrams also help to see what commits are related to a certain branch.
What is the result of merging two branches together? Why do we represent it in the diagram the way we do?
The result of a merge is that two different features or branches of work can be combined into one. We represent it in the diagram because creating a new branch goes on a different direction than the master branch and merging results in bringing those two branches together again.
What are the pros and cons of Git’s automatic merging vs. always doing merges manually?
Pros: faster, done on changes where there is clear distinction between the two files
Cons: can be confusing when changes are done to the same feature or line of code and hence a conflict will emerge