Monday, October 20, 2014

Baby's First Git Repository, Part II: GitHub Boogaloo

Imagine a super deep voice saying: Previously on Baby's First Git Repo...
We took care of the first big chunk of creating a git repo - we created a directory and one lonely file for our super awesome Paula Abdul fan site, we did our first commit, and we initialized our repo locally.

Now we set things up on GitHub. For the sake of expediency, let's say we've already signed up for a GitHub account under the nom de guerre of "straightupfan". From our profile page, the first step is to click on the "Repositories" tab:



This brings us to a list of any of our pre-existing repositories. There's a big green button that says "New". Click that:


This brings us to a screen where we name the repository, and add an optional description. Then there's another big green button at the bottom, this time saying "Create Repository". We're totally clicking that bad boy:


Kablam! Last step on GitHub is to copy a little piece of info*. We can avoid the horrible tedium of ctrl-c by clicking on the clipboard icon. Let's do it. I dare us:



*There's a caveat here. If you haven't done so, you'll need to set up an SSH key (a way of identifying that computer is safe to talk to), which I won't get into here. Here's a tutorial on that, including how to tell if you have an SSH key or not (ignore the temptation of the big orange button that says "Download GitHub for Mac". You have to learn to do this in the command line sometime.)

Okay, we're done with the GitHub part. Now we'll head back to the command line for one final step, and to push our files up to the repo.

Back in the command line, we'll use the git remote add command (don't hit enter yet - we're not done with this line yet):








Remember a couple steps ago how we clicked on that little clipboard icon?  Now we're going to paste in that content, so the entire line looks like this:



Voilá! Your repo is official and ready to use. Huzzah! And they rejoiced all through the land!

One more thing to do before you gorge yourself on celebratory meats and mulled wine. We've committed everything from our repo, but so far it only lives on our machine. We want everything in our local repo in our remote repo, so there is only one thing for it. We must, as Salt-n-Pepa once said, push it. We must push it, and push it good:




This is so exciting! We're done at this point, but let's take a quick look at GitHub one last time. Let us gaze upon our fine work. If you go to the Repositories tab again, and click on the paula-abdul repo, this will be what you see:



See how we can see our one file that we made? O how glorious! Imagine how much more amazing that's going to look as you work on projects chock-a-block with files. I am in raptures just thinking about it.










No comments:

Post a Comment