Skip to main content

GitHub Basics

"GitHub is a code hosting platform for version control and collaboration. It lets you and others work together on projects from anywhere."

To be short and sweet, GitHub is a place people can upload their projects and have old versions be reverted.

Terminology

Setting up GitHub

Fork

Once you have these downloaded, you can go to the KQM Repositories and Fork the project you want to contribute to. Doing this copies the repository and makes a version that you can change without impacting the upstream project.

You can name the repository to whatever you like on your fork. You will also want to keep the "master or main branch only" box checked.

GitHub fork

Updating Your Fork

Occasionally, KQM will accept Pull Requests from other contributors which can leave your Fork or Local Version outdated. Open your Fork and sync your Fork before every session! You can use GitHub Desktop to Pull changes from the Remote onto your own Fork.

danger

You should do this every session!

Update branch

Cloning

You will want to clone your forked version. Choose the location you want your local copy on GitHub Desktop.

Open with GitHub Desktop
danger

Make sure you select the option to contribute to the parent project! This allows GitHub Desktop help you make sure your Fork is up to date with our upstream repository.

Parent project option

You can now open these local files up in Visual Studio Code (VSC) from GitHub Desktop. Changes to this Local Version using Visual Studio Code will only be saved onto your computer, and nowhere else.

Open in Visual Studio Code

Committing

Committing your changes puts them in a staging area, and tells GitHub that you plan to send these changes to the Remote. If you have multiple changes, but some are not ready, you can untick which changes you don't want to send to GitHub and avoid committing them.

As good practice, you should try to always title your commits properly with what you changed, and add a short description if you think it is necessary or to add extra details. Try to avoid meme names, because this makes reading commit history really painful when there are errors.

Push

Once you've committed the changes you want, you can send these changes to your online repository by Pushing. A push takes all the committed changes on your local version and sends them to your online, personal fork. However, this is not all you need to do in order for your changes to be reviewed by a KQM staff member and sent to our live version.

Push

Pull Request

In order for your changes on your personal fork to appear on the live version of the project, you need to submit a pull request from your personal fork to merge into the original repository. From GitHub Desktop, after you Push your local changes to your personal fork, you can create a Pull Request. After your PR is reviewed, it can take a few minutes to appear on your project or until the project is reloaded.

Pull request

To recap, your workflow is to make the changes you want to in your Local Version using Visual Studio Code. When you save your changes on VSC, you can Commit your changes using GitHub Desktop, and Push these local changes to your personal Fork. You can submit a Pull Request to send your changes to the original repository.

Videos

Short video on how to clone/fork using GitHub Desktop.