As discussed previously, a repo is where you keep your code. If you’re like me, you will be making and changing and deleting and remaking hundreds of them.
You’re also going to need to look up how to do things just as many times. Derp.
The first place you'll see the green "new" button is on your homepage when you're logged in. It'll be on the far left side, along with a list of your other repos and a search bar.
If you navigate to your profile page and click on "Repositories" next to "Overview" you'll see it again.
When you click on "new" you'll be taken to the page to create a new repo. All you really need is:
- A repo name (e.g. my-good-dog)
- A description (e.g. A project about my dog)
- Select whether it will be public or private
Then you can click the green "Create Repository"
It's really easy to do from the command line (you’ll need to have already set up git for this).
If you've already been working on your project, you want to do the below:
Once this is done, you'll be able to push your edits/commits from the command line woo! (And always remember: save early save often.)
Now that your repo is up and running, you're in good shape. If you remember a time before computers, you also remember how much it ABSOLUTELY SUCKED to only have local copies of things and watch them go TOAST.
Now we live in the future where you can have a local copy AND a remote copy AND make them talk to each other. Which is pretty much what cloning is in GitHub.
Say your dog came along and deleted your project from your machine because you were spending too much time working and not enough time playing fetch. Now what?
Well, since you set up your repo and you've been GOOD AND CONSISTENT about making commits, you can clone it back down to your machine and pick up where you left off.
On the page for your repo, you'll see a green "Clone or download" button on the far right.
Go ahead and copy the SSH link and in your terminal, navigate to where you want your project to live. For this example, I'm just going to put it on my desktop:
And then poof! In the location you specified, you should now see a folder with the same name as your repo. If you open it, you'll see all your code safe and sound and ready to be worked on.
So now, after you play fetch with Fido, you can go back to your machine and work on your project just as you did before - it's connected to the remote repo, so you can push and commit as normal.
Next time, we'll talk about making commits. Get excited.