Become a member
to unlock all features

Level Up!

Access all courses & lessons on egghead today and lock-in your price for life.


    Setting up GitHub


    In this lesson, you'll learn how to set up a GitHub account, create a new GitHub repository, and connect your local project with that new repository so you have a place to store and collaborate on your library code.



    Become a Member to view code

    You must be a Pro Member to view code

    Access all courses and lessons, track your progress, gain confidence and expertise.

    Become a Member
    and unlock code for this lesson
    orLog In




    The first thing that we're going to want to do is create a GitHub repo for this library. We'll go to our browser and go to GitHub.com. If you don't have an account, you can sign up here.

    I do have an account, so I'll just sign in. Then, we'll go ahead and create a new repository. We'll call it "Star Wars Names," just the name of our library, and we'll say, "git-random Star Wars Name." We'll go ahead and create the repository.

    I'm just going to go ahead and copy this to the clipboard, and we'll paste it in. It'll run several of those commands and, then, we're ready to push.

    Just to explain what this actually does is it creates a new file called "readme.md," and adds "Star Wars Names" to the top. Then, it initializes the Git repository locally. We add the .readme that we just created.

    We commit with the message "first commit." We add the remote origin so, this repository. Then, we push it to master setting our upstream.

    If I refresh the browser, now, now we have our Star Wars Names and we have the .readme. We're all ready to go with a GitHub repository, and this is where we're going to be hosting our code and pushing our code.

    In review, you need to create a GitHub user. You create a new repository. Then, you follow the instructions to push your code to that repository. That's how you get started with GitHub.