Discuss Scratch
- Discussion Forums
- » Open Source Projects
- » Attempting to update scratch-gui in my fork
- rdococ
-
1000+ posts
Attempting to update scratch-gui in my fork
Right now I'm attempting to create a Scratch 3 mod, and part of that is hosting it. I'm using Github Pages and all the documentation I can find about how to host a Scratch instance, but something's concerning me.
I'm using this tutorial as a guide on how to publish my fork to Pages and doing it manually because I don't want to bother with learning Travis for now. So I'm using these commands:
They work fine, the problem is that they push commits to the gh-pages branch, but I plan to make changes to scratch-gui in my ‘develop’ branch and want to smoothly transfer them to the ‘gh-pages’ branch, meaning I'll have to merge my changes with any deployment files committed by the previous `npm run deploy`, then run it again to host the changes, creating a second commit for what is ideally a single update.
There's no real issue here per se (i.e. I doubt there will be any merge conflicts), it's just that it seems like it would make a mess of the commit history in my gh-pages branch (more so than the mess I already make
). Do I just go ahead with it, or is there a better way?
I'm using this tutorial as a guide on how to publish my fork to Pages and doing it manually because I don't want to bother with learning Travis for now. So I'm using these commands:
# Build for github.io
npm run build
# Commit and push the build result to your gh-pages branch
npm run deploy
They work fine, the problem is that they push commits to the gh-pages branch, but I plan to make changes to scratch-gui in my ‘develop’ branch and want to smoothly transfer them to the ‘gh-pages’ branch, meaning I'll have to merge my changes with any deployment files committed by the previous `npm run deploy`, then run it again to host the changes, creating a second commit for what is ideally a single update.
There's no real issue here per se (i.e. I doubt there will be any merge conflicts), it's just that it seems like it would make a mess of the commit history in my gh-pages branch (more so than the mess I already make

- rdococ
-
1000+ posts
Attempting to update scratch-gui in my fork
After some looking, it seems like the `deploy` commit entirely replaces the original contents of the branch with a compiled version, including compiled forms of scratch-vm and scratch-blocks source code. This seems very unusual, and violates my idea of what a ‘branch’ is meant to be (i.e. a particular version of the contents of the repository, not in a wholly different form), but if it works for Scratch forks then I guess it works for me.
Looking at the upstream gh pages branch, seems like the commit history is only deployment commits. After seeing how the `deploy` script works, I discovered it probably uses the `gh-pages` NPM package, and that seems to publish its commit directly to the `gh-pages` branch. And I realized that the tutorial I was following never actually specified that you need to make changes on the `gh-pages` branch and then run/deploy.
So I guess I was looking at this wrong. You just make changes on the `develop` branch, and when you're ready, run the commands and it will publish the built code to the `gh-pages` branch. Case solved?
Looking at the upstream gh pages branch, seems like the commit history is only deployment commits. After seeing how the `deploy` script works, I discovered it probably uses the `gh-pages` NPM package, and that seems to publish its commit directly to the `gh-pages` branch. And I realized that the tutorial I was following never actually specified that you need to make changes on the `gh-pages` branch and then run/deploy.
So I guess I was looking at this wrong. You just make changes on the `develop` branch, and when you're ready, run the commands and it will publish the built code to the `gh-pages` branch. Case solved?
- Discussion Forums
- » Open Source Projects
-
» Attempting to update scratch-gui in my fork