#Project 1: Mr. Potato Head
The lead teacher must clone this repository before the start of class. Students will be forking from your repo.
Students will understand the basics of version control. They will be able to setup an account on Github and perform the fork
clone
and push
operations.
- Git is an example of a version control software.
- GitHub is a service that lets programmers use Git to store their work on cloud-based servers.
- GitHub is widely used in the industry for collaboration.
- Write the Exit Ticket based off assessments from current lesson.
Students will show progress toward reaching the objective based on their performance on the Exit Ticket quiz.
- Version control
- Git
- Github
- Repository (repo)
- Clone
- Push
- Pull
- Fork
- Merge
- Stage
- Commit
- Presentation Slides
- http://gitref.org/basic/
- https://try.github.io/levels/1/challenges/1
- http://en.wikipedia.org/wiki/Revision_control
- http://en.wikipedia.org/wiki/Git_(software)
- http://git-scm.com/docs/git-merge
- Attendance
- Return reviewed Exit Ticket from the previous class.
- The Do Now can be found on slide 1 of the Presentation Slides.
Today, we will learn about collaboration through the use of Git and GitHub.
The opening lecture can be found on slides 2-4 of the Presentation Slides.
During this "I Do" lecture, the teacher is going to demonstrate forking a repo on pushing any changes using the terminal.
Find the repository you are looking for by searching its name or username of the owner in GitHub.
A repository (or repo) is a place where we store our code.
GitHub allows us to fork the repo by simply clicking the Fork
button in the top-right corner of any repository.
- Copy the "Clone URL" from this repo.
- In your Cloud9 dashboard, click on the "Create New Workspace" button and paste the URL you just copied to your clipboard.
For this project, I am going to add the arms to Mr. Potato Head in the potatohead.html file.
A push
is an action to upload the work saved on your Cloud9 to your GitHub repo.
First, we make sure that our changes were completed properly. We do this by using the git status
command.
Git has detected that we have changed the file. But as it notes, we must add it to our list of files we want to update. We do this by:
git add .
The "." signifies adding all the changes you made.
When we commit
a file, we tell Git that we're about to make our change final. This gives Git a chance to record any changes made. We also need to provide a message saying what changed so that other programmers can understand what we did.
git commit -m "added arms"
We are now ready to push
our modified code to Github's servers. We do this by:
git push origin master
You can now go to your repository on GitHub and see the changes you made.
Now that our repo is up to date we will need to ask the owner of the orignal repo to accept our changes with a pull request
.
A pull request is completed by clicking the small green button on the repo page
Before everyone gets started on this project, we will divide up in pairs and assign a Potato Head body part to each pair.
The teacher will match each grouping of students with a body part:
- Arms
- Ears
- Eyes
- Mouth
- Nose
- Eyebrows
Build the Potato Head.
- Fork the instructor's repo.
- Clone your new repo in cloud.
- Add your Potato body part to
potatohead.html
.
In the Cloud 9 terminal, type the following commands:
- git status
- git add .
- git commit -m "Commit message"
- git push origin master (or whatever initial branch is, typically master)
After pushing your code, send a pull request to the owner of the repo.
Give the Exit Ticket.
Accept all of the pull requests and show off everyone's work on the board by plugging the potatohead.html URL into www.rawgit.com
Remind students when homework is due and how it will be collected.
- Review the Exit Tickets.
- Prepare for next lesson / hand off to next volunteer in rotation.