Source: Cloning a repository in the GitHub Docs.
- Create a GitHub repository
- Clone a GitHub repository to your local machine.
- Add an empty webpage to a local repo
- Commit changes to
index.html
. push
changes to GitHub.- Deploy your GitHub repo to GitHub Pages.
- GitHub repository created.
- If cloning using SSH, you will need to configure SSH keys.
-
On GitHub, navigate to the main page of the repository.
-
Above the list of files, click "Code".
-
To clone the repository using HTTPS, under "Clone with HTTPS", click the copyboard icon. To clone the repository using an SSH key, including a certificate issued by your organization's SSH certificate authority, click Use SSH, then click the copyboard icon.
-
Open Terminal.
-
Change the current working directory to the location where you want the cloned directory.
-
Type
git clone
, and then paste the URL you copied earlier.$ git clone https://github.com/YOUR-USERNAME/YOUR-REPOSITORY
-
Press Enter to create your local clone.
$ git clone https://github.com/YOUR-USERNAME/YOUR-REPOSITORY > Cloning into `Spoon-Knife`... > remote: Counting objects: 10, done. > remote: Compressing objects: 100% (8/8), done. > remove: Total 10 (delta 1), reused 10 (delta 1) > Unpacking objects: 100% (10/10), done.
-
Navigate to your new cloned directory.
$ cd YOUR-REPOSITORY