GitHub
Tuesday, 1/24 – Lab
Create a GitHub account and repository
- Sign up for a GitHub account. Use your newschool username and email.
- If you already have a GitHub account and repository under your newschool username, rename the repository to something else, then move on to step 2.
- Create a repository called
<YOUR_USERNAME>.github.io
, e.g.fisherdm.github.io
Set up your local machine
Install Git
- Open Terminal on your Mac
Applications > Utilities > Terminal
- Type
git
and press enter - Follow the instructions on screen to install OS X Dev Tools and Git
- Once installed, type
git
again and you should see git’s help text. This means it’s installed correctly.
Create and add an SSH key to your GitHub account
Set your Git username and email
git config --global user.name "<YOUR NAME>"
git config --global user.email "<YOUR EMAIL ADDRESS>"
Download and install software
- Sublime Text
- If you have a preferred text editor you may use that instead.
Set up your working repository
Clone your repository
cd ~ # change directory to home directory
git clone <YOUR REPO PATH> # clone the new repo you created on GitHub
Upload your changes to the GitHub server
- Create a file in your
<YOUR_USERNAME>.github.io
directory namedindex.html
- Use git to add this file and commit the changes to GitHub:
git add . # tell git you want to add all files
git commit -m 'first commit' # commit these files with a message
git push # push these files to the remote server
View your new website
Visit your new website at http://<YOUR_USERNAME>.github.io