Introduction to the JAMStack

Deploy a GitHub Repo

Jason Lengstorf

Jason Lengstorf

Learn With Jason
Introduction to the JAMStack

Check out a free preview of the full Introduction to the JAMStack course

The "Deploy a GitHub Repo" Lesson is part of the full, Introduction to the JAMStack course featured in this preview video. Here's what you'd learn in this lesson:

Jason demonstrates how to deploy a repository to GitHub, and how to use the hub tool. Hub makes deployment more seemless.


Transcript from the "Deploy a GitHub Repo" Lesson

>> To deploy this, what I'm actually gonna do is just create another repo inside of here. This is not particularly good Git hygiene, but we're all learning together, right? So let me let me push what I've done first. So that's now up on the fem-progress branch, if you wanna check out where we are now.

And then I'm in the sections/basic, and I'm just gonna run, git init. And what I'm doing with git init, here, is I'm setting up a new repo. So if I look at my git status, it's gonna show us these three files as untracked. And that's because I've just kind of set up a whole new Git repo in here.

So what I wanna do is I wanna create a new repo. And I'm gonna take a quick detour here to show you one of my favorite tools that I found in a long time. It's called hub. And what hub does is it gives you a whole bunch of amazing CLI benefits.

So feel free to install this or not, this is completely optional. But if you work in GitHub often, this is a tool that legitimately has improved my life. And so what it does is it gives us a set of tools that we can create new repos. We can open the GitHub repository right from the command line.

We can create pull requests, and approve pull requests, and check out pull requests. All these things that take a lot of time, if you do them through the UI, you can do it all from the command line. And so that's gonna help us as we move through a lot of today.

And it'll help anyone who works on a Git-based workflow. It should help you quite a bit. And so what I've done is I've actually gone in and created an alias for it in my dot files. So I ran the brew install hub to get it. And then if I open up, Where is it?

The my bash_profile. Boy, I'm really bad at this aren't I? There it is. So I have a lot of aliases to help me out. This is that git status one. But the one that I'm specifically talking about here is I've aliased git to hub. So hub does all the things that git does regularly, but then it just adds that extra layer of utility on top of it.

So when I'm using git, I don't notice that I'm using hub. But then when I need those extra tools, this really helps. So what I can do now that I have this, is I can just say, git create, and I'm gonna call this jamstack-intro-basic. And so it's now created a repo for me.

So, with that repo, I can git add everything. We'll check it, good. Let's git commit that and say, my first JAMstack site. And then I'm going to push that to master. If you didn't want to install hub, you can go to Let me open this in a browser where I'm logged in.

Make that smaller, okay. So if you don't wanna install hub, you can go to GitHub, and up here at the top, you can hit New repository. And you can call it whatever you want. Well, you could say, It can be Public or Private. I mean, I recommend going public by default unless you've got a really good reason.

And then I'm gonna leave everything else empty, create my repository. And then, Would follow these instructions here. So we initialized the repo already. We would add our files, and then you just follow these steps, git remote add. And you set up your origin and point it to this new repo that you've created.

And then you can git push origin master to get the files up.
>> You did the git init in the basic folder or in the root?
>> Well, so I want the basic folder to be the root of this particular example. So, yeah, you run git init in whatever what you want the root of your site to be.

So if I go back over here, and I can say, git browse, and this is a hub tool, it will open up this repo that we just created.

Learn Straight from the Experts Who Shape the Modern Web

  • In-depth Courses
  • Industry Leading Experts
  • Learning Paths
  • Live Interactive Workshops
Get Unlimited Access Now