-
Notifications
You must be signed in to change notification settings - Fork 0
/
lesson_2_reflections.txt
20 lines (14 loc) · 2.18 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?
Initializing creates a .git hidden directory which will contain repository and version information. You need to do this to distinguish a regular directory from a repository and be able to use version control.
How is the staging area different from the working directory and the repository? What value do you think it offers?
The staging area is like a holding pen that lets you review your potential commits before you actually commit. It also allows you to 'group' files together that you deem connected or related.
How can you use the staging area to make sure you have one commit per logical change?
With the staging area you can use 'git status' to ensure that the logical change you make is only contained in the files in the staging area. This means you can check on what will be commited before the next 'git commit' command.
What are some situations when branches would be helpful in keeping your history organized? How would branches help?
Branches are useful if you want to test out a new experimental feature. Branches help because you can keep the experimental code separate from the master branch code.
How do diagrams help you visualize the branch structure?
Diagrams illustrate how each commit has a parent, and also which commit branches are created from (branch from). They also aid in showing if certain commits are unreachable.
What is the result of merging two branches together? Why do we represent it in the diagram the way we do?
Merging two branches combines the code (additions and deletions) into the master branch. In the diagram it shows two branches coming together as one and containing both the code addition/deletions of both branches as well as the commit histories of both branches.
What are the pros and cons of Git's automatic merging vs. always doing merges manually?
Pro: If the changes are easily merged with no conflicts, then this automatic merging can prevent typos and also save time. Con: if there is a conflict in the merge or if the code post-Git-auto-merge still isn't quite what both programmers intended, then this could cause a bug or unintended behavior in the code. In this case a manual merge is best.