-
Notifications
You must be signed in to change notification settings - Fork 0
/
lesson_2_reflections.txt
36 lines (23 loc) · 2.02 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
29
30
31
32
33
34
35
36
What happens when you initialize a repository? Why do you need to do it?
When i initialize a repository, a hidden file .git is added to the folder.
The current folder is setup as a master branch. And there is an initial commit.
Since there is no current commit, git log throws error.
The contents of the directory (files in it) are added as untracked files.
How is the staging area different from the working directory and the repository? What value do you think it offers?
Staging area is intermediate state between working directory and repository. We can selectively add files to the staging area.
More than one file in the staging area can be pushed into repository as a logical unit.
I think, the staging area lets user decide the files to be included in one commit as opposed to committing all files together.
How can you use the staging area to make sure you have one commit per logical change?
I can run git add for only those files that i want to be part of one commit.
Since all the files in staging area are committed together to repository, we have one commit for logic change.
What are some situations when branches would be helpful in keeping your history organized? How would branches help?
When you are trying some experimental feature which might not go into main branch.
If these features succeed, then that branch can be merged with the main branch later.
How do the diagrams help you visualize the branch structure?
Diagrams help me identify which branches contain which commits. It in turn helps me in identifying the branches state, unreachable commits.
What is the result of merging two branches together? Why do we represent it in the diagram the way we do?
Commits from both branches would be merged into one of the merged branches. The checked out branch label is what the merged branch retains.
What are the pros and cons of Git’s automatic merging vs. always doing merges manually?
Automatic merging:
pros: git intelligently identifies the changes that are not done on same area in the code and merges it
cons: not sure