I’m helping @mickfuzz on https://github.com/webgameclubs/edlab-gamemakers-club. 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 https://github.com/webgameclubs/ 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”.
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…
…and pick “Import From GitHub”
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.
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”…
…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…
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.