Glitch and GitHub Workflow

I’m helping @mickfuzz on Right now I’m trying to map out how we can manage the development of educational materials on GitHub and have that delivered using Glitch. This post is an illustrative example.

1. Start From GitHub

Once you’ve decided that you want to contribute then head over to the GitHub repository and find the repo of the game you want to contribute to. If you are contributing a new game then raise an issue in the main site repo asking for a new game to be added.

2. Fork the Game’s GitHub Repo

You won’t be able to edit the game code in the main repo directly. Rather you need to “fork” the game into your own user repo.  In this example I’ll fork “simple-game-to-edit”.

Once forked you need to note the name of the repo. Mine is “davegoopot/simple-game-to-edit”.

2018-09-15 10_54_55-davegoopot_simple-game-to-edit_ Basic game staring point for coding session.

3. Load Into Your Glitch Project

Open and existing or create a new project on Glitch. Keep in mind that if you are using an existing Glitch project then its contents are just about to be overwritten.

With the Glitch project open, find the “Advanced Options” section…

2018-09-15 – flannel-church

…and pick “Import From GitHub”

2018-09-15 – flannel-church

The first time ever you do this you will need to enter your username and password into GitHub. Once you are set up the first time you will not need to do this again.

Glitch then asks you to confirm the name of the repository you want to import. Here I enter “davegoopot/simple-game-to-edit”. Press “OK”. Wait a moment or two and hey presto your Glitch project has all the contents from GtiHub.

4. Make Changes Using Glitch

Go ahead and edit your code in Glitch. Keep making changes until you are happy with the result.

5. Export Your Code Back to GitHub

When you are ready to push your code back up to GitHub the in Glitch choose “Advanced Options” and then “Export to GitHub”. Make sure the name of your personal repo is still correct and press “OK” to send your changes to GitHub.

Once the export has completed, go back to your personal GitHub repo page and you should see that the changes have arrived in a new “Glitch” branch. Press the “Compare & pull request” button to merge in your changes to the mainline of your code.

2018-09-15 11_04_44-davegoopot_simple-game-to-edit_ Basic game staring point for coding session.

6. Create Pull Request Into Main Repository

The the code successfully merged into your repository you can now create a pull request to have your changed merged into the main webgamesclub repository. Press the “New pull request button”…

2018-09-15 11_23_27-davegoopot_simple-game-to-edit_ Basic game staring point for coding session.

…and this time choose to merge into the webgamesclub repo. Make sure that you give your pull request a meaningful comment so that the maintainers can understand what you’ve changed. Something like this…

2018-09-15 11_26_07-Comparing webgameclubs_master...davegoopot_master · webgameclubs_simple-game-to-

Once you submit your pull request it will be reviewed by the maintainers of the main repo and then merged into that main repo code.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s