forked from KeslerPhyz/git_intro_1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathworksheet.txt
104 lines (65 loc) · 3.83 KB
/
worksheet.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
GIT PRACTICE WORKSHEET
(If you haven't already gone through the steps in "setup_instructions.txt,"
you should do those first)
To learn about using Git, we're going to do something that should be familar
from school: fill out a worksheet.
As you go through and answer questions, think about the separate places that your
changes (answers) get recorded: the file on your computer, your local Git
repository, and your remote Git repository. Any work you do has to get to that
last stop if it's going to be used by your team.
*****************************************************
Answer the question below in the space provided, then SAVE THE FILE.
1. WHAT DID YOU LAST HAVE FOR LUNCH?
ANSWER 1:
Take a look at the file in your GitHub web browser window. Notice that your changes
have not yet shown up here.
Now look in GitHub Desktop.
You will need to do 2 things to get your changes into the online repository.
A) You will need to COMMIT the changes WITH A TITLE AND DESCRIPTION, which officially
"saves" them in your local repository. In the lower left corner, enter a title and
description and press the blue button.
B) You will need to PUSH the changes, which applies changes from any commits to the
remote repository. Click the "push" button at the top, then confirm in your
web browser that the file has changed online by reloading the page.
Talk with your teammates about the possible reasons this process was set up with its
multiple steps.
*****************************************************
Answer the question below in the space provided, then SAVE THE FILE.
2. WHAT IS YOUR FAVORITE MOVIE?
ANSWER 2:
Repeat the process from above, making sure to ADD A TITLE AND DESCRIPTION
explaining the changes that were made. (Being descriptive here saves
a lot of time later on, so make it a habit!)
After you've done that, look at the web browser view of Git. Click on the "Code"
tab to see the overall repository, then click on "Commits" to see the history of
of commits that have been made.
Talk with your teammates about why this could be helpful and why including messages
with commits is important.
*****************************************************
For the next part, we are going to work with Git's most important use: branching.
In GitHub Desktop, click on "Current Branch" at the top of the window. In the
textbox, type in "Question_3" and then click on the "New Branch" button. Then
click on the "Publish" button.
You now have a separate branch where you can make changes without affecting the
master branch, or the "main" version of your repository.
In VS Code, type in your answer to Question 3 below, save it, and then commit and
push the changes to the new branch.
3. IF YOU COULD TRAVEL TO ONE PLACE IN THE WORLD FOR A WEEKEND, WHERE WOULD
YOU GO?
ANSWER 3:
Now look at the Git repository in your web browser by clicking on the "Code" tab.
You should be seeing the master branch (check that on the lefthand side), and when
you look in the worksheet.txt file, you shouldn't see your answer to Question 3,
EVEN THOUGH YOU PUSHED THE CHANGES. That's because your changes have been saved
on a SEPARATE BRANCH – they've been saved, but they haven't been made in the main
version yet.
Now, in the web browser, click the pencil icon to edit the worksheet.txt file by
filling in an answer to Question 4 below. When you're done, go to the bottom and
WRITE A TITLE AND DESCRIPTION and click the "commit" button.
4. IF YOU WENT TO THE PLACE FROM QUESTION 3, WHOM WOULD YOU LIKE TO TRAVEL WITH?
ANSWER 4:
SO, we now have two separate versions with answers to separate questions that we
ould like to combine ... and we can do that!
In the web browser, go back to the overall view of the repository by clicking on
the "Code" tab. Select the green button prompting you to "Compare and pull
request."