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!
Setting A New Path Upstream
Our new home upstream
Let’s review our progress so far
We’ve made our new recipe, we’ve learned how to make a pull request to a repo that isn’t ours, and how to push our progress to a repo that IS ours.. We’ve learned how to check when something’s been saved correctly and when we have unsaved changes, but we haven’t covered how to connect the repo on our computer with our existing work to the repo we created on the website which is still blank. If our computer catches on fire right now, humanity will never know the joy of Purtle’s Magic Pineapple Mushroom Pizza, and that just can’t happen, so let’s get cracking!
You will need
For this you’ll need the url to your new git repository, probably a github link to your personal page like
https://github.com/rocksteadytc/dessert-pizzas and you’ll need the
dessert-pizzas repo with the commit’d but un-pushed work that we’ve just created in the last class.
Note: If you’re using Github, when you created the new blank repo, it already told you how to do this, if you were clever and read what they were telling you. If you missed that, no worries, we’re about to work through it now.
Prepare yourself, this will be really hard
Just kidding, this part will usually only fail if you’re not in a git repo when typing the command, or if you misspell the URL, both are minor errors with easy fixes.
git remote add origin https://github.com/RocksteadyTC/dessert-pizzas.git
This will store the remote location of your repository so that at the end of the day you can send your commits to Github where they can have lots of room to run and play with the other commits.
git push -u origin master
This is the command that, now that we know where we’re pushing to, will initiate the pushing process. Pushing takes your commits, does some fancy magic which reduces it to only the changes you made, and sends it off to Github or whatever your remote location is. At this point you can toss your computer in the pizza oven and restore your work on a new one just the way it was when you pushed it. Remember, if you haven’t pushed a commit, it may as well have never happened.
So now that we’ve linked ourselves to our own pizza repository and uploaded our dessert pizza recipe, we should add some more recipes to put this thing into high gear! Add a few of your favorite pizzas, and maybe separate them in folders for
dessert-pizza if you’re really fancy.
Remember, add, commit, then push, and don’t forget to use very descriptive commit messages to make tracking your recipe changes easier.