After you’ve created a repository on the remote, the next step is to clone it to your local environment.
- Navigate to your repository’s Code tab.
- Click Clone or download.
- Copy the URL provided.
-
Open your command line or Terminal application and enter the directory where you would like to copy the repository. This can be anywhere in your local file system, like your home directory. For example:
cd ~/
-
Clone the repository by replacing
<URL>
with clone URL you copied in the previous step. The repository will be cloned into a new directory in this location.git clone <URL>
-
Navigate into the directory of the repository you just created. Replace
with your own repository's name. cd <REPOSITORY-NAME>
-
Type:
git status
git status
is a command you will use often to verify the current state of your repository and the files it contains. Right now, we can see that we are on branchmaster
, everything is up to date withorigin/master
and our working directory is clean.
Tell me why
Remote vs. Local Repositories
Let’s take a moment to define a couple of important terms:
A remote repository is the copy of your project that is housed on GitHub.com. You access this copy through a unique URL.
A local repository is a copy of the remote repository that you have cloned to your computer. This copy includes all of the files, history, and branches in your project.
In this class, you will make changes to this local repository and then sync them with the copy of your project on GitHub.com.