-
Notifications
You must be signed in to change notification settings - Fork 0
/
lesson_2_reflections.txt
28 lines (27 loc) · 1.9 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?
创建了一个git repository。为了跟踪文件的修改
How is the staging area different from the working directory and the repository?
What value do you think it offers?
staging area是一个中间位置,git add的文件会放到staging area。git commit是提交
到repository。增加staging area可以一次commit提交多个文件,通过add多个文件到staging
然后commit把Staging area中的文件提交到repository中。
How can you use the staging area to make sure you have one commit per logical
change?
每进行一次逻辑修改,就git add一次,然后git commit
What are some situations when branches would be helpful in keeping your history
organized? How would branches help?
修改bug,尝试新特性
How do the diagrams help you visualize the branch structure?
可以清楚的看清分支是从何时创建的以及各个分支包含的提交有哪些,有那些提交
是不同的
What is the result of merging two branches together? Why do we represent it in
the diagram the way we do?
1、合并分支是将两个分支上的修改合并到一起。通过两个分支最后的两个节点做比较,
并以两个分支分开之前的节点作为参考进行合并。合并结果会放到检出的分支,因
此如果要合并到那个分支就checkout到那个分支。
2、在图形中表示合并的方式,是因为合并并没有把之前的commit都删除或者整合到
同一个分支,只是把代码的修改整合到一起,之前的提交都还保留,方便查看。
What are the pros and cons of Git's automatic merging vs. always doing merges
manually?
自动合并可以又git自己完成,不需要人工,节省人力和时间,但是自动合并无法确定是否正确
人工合并可以确定修改是否是必要的,正确的,以及如何合并。