Subtitles section Play video
What's the first step in using GitHub?
Initializing a repository;
We'll show you how.
[GitHub & Git Foundations]
Hi, I'm Tim Berglund.
Welcome to another episode of GitHub Foundations.
In today's episode, we're going to talk about
how to initialize a repository.
That's a thing you can do locally, on your computer,
or in the cloud at github.com.
We'll show you both ways.
[Local Repository]
Suppose you've already got a project going
on your computer.
You've done some work, and then you realize
you should really have this going under version control.
It's simple. When you're in your project directory,
at the command line, just type git init.
It turns the directory into a git repository,
and it's completely non-destructive.
If you're feeling a bit more disciplined,
maybe you'll want to get the project
under source control before you get started.
This is easy too.
Before you begin a new project, just type git init,
and then the name of the directory you'd like git to create.
That's the name of the project.
That'll create a directory already initialized
as a git repository.
Git is useful locally, but the real magic happens
when you start to collaborate with other people on github.com.
Let's look at how to create a new repository there.
[Repository on GitHub.com]
Just sign in to github.com
and look for the new repository button.
Click on that, and then type in a name for your project.
Mind you, this name doesn't have to be globally unique.
It just has to be unique within the repositories you have.
Your username serves as
a name space for all your project names,
which makes picking one a lot easier.
Now decide whether you want the repo to be public or private,
and whether you want GitHub to create a "Read Me"
or a .gitignore file.
The "Read Me" just tells people what your project is about.
.gitignore tells git what files you don't want
under version control.
We'll cover this more in a future episode.
If you already have a project on your computer that you want
to push up to GitHub, skip those steps.
If you haven't made a project locally on your computer yet,
it can be really convenient to have GitHub create that
"Read Me" and .gitignore file for you.
After you've got a local repo on your computer,
and one up on github.com, you're going to need
to get the two of them connected.
GitHub gives you some help in that direction,
but before we get there, there's some other material
we'd like to cover first.
[Thanks for watching]
Thanks for watching this episode of GitHub Foundations on Init.
If you liked this, subscribe to GitHub Guides right here,
and don't forget to check out our other GitHub channels
down here. If you have a question or a comment, as always,
we'd love for you to leave that down below, and if you want
to see more training videos like this one, check out
these guys down here.