Welcome To Turtle's Community Pizza Shop
Welcome to Turtle's Pizza Shop, a restaurant where anybody can submit their favorite recipes for a chance to win free pizza for a month if your recipe is chosen! In this section you're going to get a copy of the recipe book and use Git to add your signature pie for an entry in the contest!
Welcome To Purtle's Community Pizza Shop
Oh no! Purtle lost the contest and wants to make his own pizza shop now. What happens in a community when two parties disagree over the path of a developing project? We use a fork! Git also allows us to branch off from projects and continue our own paths. Our adventure continues when Purtle opens Purtles Perfect Pizza!
Creating A New Recipe Book
"DISQUALIFIED: PINEAPPLE IS DESSERT PIZZA"
Things Don’t Always Work Out
It happens. Pull requests for whatever reason get denied, but we’re not out of options yet. We’ll show them! We’ve already covered most of the steps you need to maintain your own repository, so let’s get started from square one with a fresh repository called
This is unacceptable! Our recipe got rejected on the basis that pineapple pizza is a dessert-pizza! We’ll show them, let’s start our own recipe book, this one will be better!
In a new directory, outside of the one we were just in, create a new repository for our new recipe book like this:
git init dessert-pizzas
Copy our pineapple pizza recipe to this new folder, and repeat the process to add your new files to be tracked. Just in case you forgot the last lesson already, it goes something like this:
git add filename-recipe-1.txt
This will add recipes individually, but to add all files in a whole folder, you can also do something like this:
git add .
Don’t forget the
. at the end of that last command! The
. means ‘this directory’ and a
.. means ‘the directory above this one’ or ‘parent directory’
As always, when we want to make a bookmark in our progress, we do a commit. This will give us something to ‘push’ later when we’re ready to send our commits to the Git tracker.
git commit -am "creating dessert-pizzas repo"
Our new dessert-pizza recipe book
Now that we’re in a brand new repository, we can push directly without making a pull-request. However, where are we pushing all of this to once it leaves our local system?
Before pushing our commits anywhere, let’s review that we’ve added and committed the file correctly:
git status will tell you if you have saved changes without a commit
git log will give you the most recent commits. If your commit was successful, you’ll see it in the output from this command in chronological order.
Create a new repository called
dessert-pizzas on your Github account, and let’s see what we can do about pushing to our new repository in the next unit.