Intro to Git

Creating A New Recipe Book


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 dessert-pizzas


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.


Leave a Reply

Your email address will not be published. Required fields are marked *

GiottoPress by Enrique Chavez