-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlesson_3_reflection.txt
65 lines (50 loc) · 3.35 KB
/
lesson_3_reflection.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
When would you want to use a remote repository rather than keeping all your work
local?
Remote repository is useful while working in a team and working on open-source projects.
I personally see remote repo as a backup too, because if your computer burns down, you
can get a new one and clone repo to resume working! :) So in my opinion, one should make
it a habit to commit every logical change to local repo and push it straight away to remote
repo.
Why might you want to always pull changes manually rather than having Git
automatically stay up-to-date with your remote repository?
The most important reason is to be able to choose which local branch you want
to pull changes to. It is possible that on remote repo there is only 'master'
branch, but locally you are working on an experimental branch, where you need
new changes. Also sometimes you just want to create another branch and pull
changes to just see if all is good and then proceed further by merging.
Describe the differences between forks, clones, and branches. When would you
use one instead of another?
Forks - When you want to create your own version of someone else's project.
This is the best way to credit the original creator and have your own version
for sharing with others.
Clones - When you create a copy of your own project from GitHub to your computer
or copy of your local repo on your computer. You can clone someone else's project
from GitHub, too, however you should always credit creators and follow licensing
requirements for any repo.
Branches - A way to separate working copy from experimental, work-in-progress
changes. Later on one can merge them.
What is the benefit of having a copy of the last known state of the remote
stored locally?
One can compare how many commits are missing or outstanding between local and
remote copy of repo. Also keeping a local copy helps decide Git if the 'git pull'
will result in a fast forward merge or not.
How would you collaborate without using Git or GitHub? What would be easier,
and what would be harder?
Collaborating without using Git or GitHub will be very difficult and it will
require using multiple tools like Dropbox, Email, diff commands, etc.
The easy thing will be no need to learn Git/GitHub and use conventional tools.
However, tough parts will be many. For example, one will have to manually review
every change made and compare with previous change. Also collaboration with
remote teams on the same project will be harder and a nightmare.
When would you want to make changes in a separate branch rather than directly in
master? What benefits does each approach have?
When one is not sure if the changes will break the master code or not, one
should make changes to a separate branch and get opinion from other team
members by creating a pull request. This will avoid the pain created by
accidentally changing master and rendering it useless and then spending time
to fix it. Moreover, with changes in other branch being made by multiple team
members simultaneously, it is easier to moderate changes and only merge
pull requests which are correct.
Making a direct change to master is good when you're not working in a team
and changes are made to documentation e.g. Readme.md file or adding comment
in code, etc.