To recap what we've done so far:
- Git is installed and confirmed working on your computer
- You have an account at Github.com and you are able to SSH into it
...now let's create a new repository. Repository is a Git term, and it refers to a project/directory that's being tracked by Git.
As an example, we'll create a new repository called
hello-world to practice with. Then later, you'll follow these same procedures when creating individual repositories for Projects 1, 2, 3, and 4.
A new repository can be created on your computer and then pushed to Github.com. Or, you can create the new repository on Github.com and then pull it to your computer. Right now, we'll go the latter route.
In Github, create a New Repository (https://github.com/new) called
hello-world, using the the following settings:
Next you want to clone the
hello-world repository to your computer, which requires finding the SSH address for the repo (as shown in the following screenshot.)
In this example, the address is
email@example.com:susanBuck/hello-world.git. (If you're seeing an address that starts with
https, click the blue text that says Use SSH).
Via command line on your computer, navigate to your htdocs folder where where you'll clone the
$ cd /Applications/MAMP/htdocs/
$ cd c:\xampp\htdocs
htdocs, execute the following line to clone your repository on Github.com to your computer, replacing
$ git clone firstname.lastname@example.org:yourGithubUsername/hello-world.git
If all went well, you should see git clone the repository, and once it's completed you should have a folder called
hello-world in your document root (
That's it for setting up your repository. In the next note set, we'll see how to track changes in the repository.
If something went wrong with creating this repository and you need to start over:
- Follow the steps under the Delete section in your repo's settings on Github.
- Remove the
hello-worlddirectory on your computer from your document root folder.