Git Task Instructions

gitTask_Instructions

User Manual:

Open the PDF directly: View PDF PDF.
Page Count: 4

DownloadGit Task Instructions
Open PDF In BrowserView PDF
Name:

10MPRO Unit 3: Organisation and Resources
Git and GitHub Task

In this task you will examine an existing GitHub repository, answering questions about it and
making changes of your own. By following the step-by-step instructions you will learn how to
Fork, Clone, Commit, Push, and interpret a Git repository.

Step

Instructions

Marks

1.

First, make your own personal copy of the repository on GitHub.
 Visit:
https://github.com/NorthcoteHS/gitTask
 Click “Fork” in the top-right corner. You may need to log in first.

1

2.

Next, create an empty folder to clone your fork into.
 In Brackets, use the Project drop-down to “Open Folder…”
 Create a new folder within 10MPRO called gitTask and click “Select
Folder”

1

3.

Now, clone your new personal copy to your local computer.
 On your fork (in GitHub), click the green “Clone or download” button.
 Click the
“Copy to clipboard” button beside the URL.

1






4.

In Brackets, open the Git extension (the
Git button on the right)
In the “Git tray” at the bottom, click the “Clone” button
Enter the URL you just copied (Ctrl-V or Cmd-V to paste)
Hit OK (no need for Username/Password)

Great! Now you’re set up with the repo.
To answer the next few questions, you’ll need to get familiar with the buttons
on the Git Tray. Take a look at them now.

1.
3.
5.
7.
9.
11.

Select all changed files
Show Git history
Refresh Git panel
Remote picker
Pull
Git Bash

2.
4.
6.
8.
10.
12.

Commit selected changes
Show file history
More actions (“Hamburger”)
Fetch
Push
Git Settings

Name:
5.

Press the

Git History button for a full list of commits.

4

a. What is the message on the most recent commit?

b. What is the message on the very first commit?

c. What date was the first commit made? You can find out by hovering
over the date (“3 months ago”) – a tooltip will pop up with the
specific date in MM/DD/YYYY format.

d. Who was the author on both of these commits?

6.

You can get more information about any single commit by clicking on it in
the list. Find the commit with message “Add draft of UI” and click on it.

3

a. How many files were changed in this commit?

b. How many lines of text were added to the first file (sources.txt)?
These are indicated by green text with + at the start.

c. Why don’t the other files in this commit show text being added or
removed?

7.

Each commit has a unique identifier, called a “hash”. The first 7 characters of
each hash are shown on the right edge of the commit list. Find the commit
f5b85bb.
a. Who is the author of this commit?

b. What is the author’s email address?

c. What date was the commit made?

4

Name:
d. What are the last 5 digits of the full hash? This can be found by
clicking the “…” next to the hash in the commit summary.

8.

Another useful tool is the File History. Select createAccount.py in the file
tree on the left, then click on the File History button.

2

a. How many commits were made affecting this file?

b. Who improved the “yes/no” logic in the file?

9.

Use the commit history and/or file history to answer these questions:

3

a. Who was responsible for adding the photo assets?

b. When was Denny’s first commit?

c. What new app names were added to the list of name ideas on Feb. 5?

10.

Next we’re going to make some changes to the repo. Before doing anything,
we need to set up our username and password. Click the hamburger and:

2

a. Select “Change git username” and enter your full first and last name
(with capital letters and a space).
b. Select “Change git email” and enter the email address you use for
GitHub.
11.

Look again at the most recent commit.
a. What did it change?

b. This commit was a mistake, and we want to undo it. Click the
hamburger and choose “Undo last local (not pushed) commit”. What
happens in the Git tray?

5

Name:
c. We want to completely get rid of those changes, so click again and
select “Discard all changes since last commit”. Now what does the Git
tray say?

d. This commit still exists on our GitHub repository, which is why the
Pull icon has a number beside it now. We want to get rid of it
entirely on GitHub. Note: this next action is very dangerous, and
should only be done as a last resort and if everyone who uses the
repository knows it is happening.
Open the Git Bash and type:
(the -f means “force”)

git push -f origin master

When done, close the Git Bash, and hit the
changes when you hit refresh?

Refresh icon. What

e. Go back to your browser and examine your GitHub fork. Refresh the
page – what message does it say about your branch and
NorthcoteHS:master?

12.

toDo is missing a file extension. Add an appropriate file extension and
commit it with an appropriate message.

2

13.

Every GitHub project is made better by a readme that describes the project
to others. Add a file named README.md at the root level with the following
text, and commit with an appropriate message:

2

# Pet Dating App
Our app puts playdates in the paws of your pets!
## Authors
Jodie, Allen, Elyse, and Denny

14.

You’re all done! Push all of your commits to your GitHub fork using the
Push button. You will need to enter your GitHub credentials.

1

15.

Back on your GitHub page, find the “Pull request” button on the right (under
the green Clone button).
 Click it, then hit the green “Create pull request”.
 Enter your name in the “Title” field, then hit the second green “Create
pull request” button at the bottom.

1

This submits your fork’s changes back to the original repository for review!



Source Exif Data:
File Type                       : PDF
File Type Extension             : pdf
MIME Type                       : application/pdf
PDF Version                     : 1.5
Linearized                      : Yes
Author                          : Erik Koopmans
Creator                         : Microsoft® Word 2016
Create Date                     : 2018:09:13 10:43:22+10:00
Modify Date                     : 2018:10:08 22:09:08Z
Producer                        : 3-Heights(TM) PDF Optimization Shell 4.8.25.2 (http://www.pdf-tools.com)
Page Count                      : 4
Language                        : en-AU
Tagged PDF                      : Yes
EXIF Metadata provided by EXIF.tools

Navigation menu