Git is a version control system that is widely used within the developer community. Git will record changes made to our files and allow us to revert to older versions. You can read more here. We’ll be using Git to publish our class websites through a Git repository hosting site called GitHub.
First, we have to set up our GitHub account and make our first repository:
- Make an account on GitHub (make sure to verify the account)
- Make a new repository by clicking the “+” in the top-right and selecting “new repository”
- Name your repository whatever you would like (or something like "class-site" if you can't think of anything)
- Check “Initialize this repository with a README”
- Create the repository
Now to initialize GitHub Pages on our repository
- On the repository page, navigate to the settings tab and select "Pages" from the sidebar
- Change the source from “none” to “main”
- The settings should save automatically
Next, we need to create a link between our local files and the online repository:
- Download GitHub Desktop
- Open the GitHub Desktop application and login with your GitHub credentials
- Go to File > clone repository
- Select the “class-site” repository
- Change the local path to a location that is unlikely to change
- Click “clone”
Now we have a local folder that is linked to our Github repository. Next, we just need to make our index.html and publish the changes!
- Find the folder that you just created
- Open Atom, create a new file, and name it index.html
- Add all the necessary ingredients to the html document
- Make sure to add something in the body, so you can confirm it is working
- Open the GitHub Desktop application
- Select the “class-site” repository in the left-hand panel
- It should show that there is 1 changed file
- In the bottom-left dialog box, name the change (called a “commit”) something like: “create index.html” (it can be anything you like, but the clearer the better)
- Click “Commit to main
- And, finally, click the “Push origin” button in the top-right
- The changes that we made locally are now hosted online in our github repository!
- Any time we make changes locally to our folder, we will need to make sure to commit those changes and push them using the GitHub Desktop application before they will be reflected online
Your website will be published to your-github-username.github.io/respository-name. If you don’t see the changes reflected, wait a minute or two, sometimes it takes a second for the changes to update.
Spend some time setting up your class site. You can design it however you like. Think ahead and consider the content that we will be adding to our class sites over the course of the class in order to determine the ways that it can grow or adapt to the content being added. But don’t fret too much at this point, the class site will hopefully change quite a bit over the course of the class as you learn more. This will be your personal portal to every project that we do in this class. Make it personal! The only requirement is that it’s navigable and that all the links work!
Start by adding the progress you've made on your Passion project and 1 reading response!