Skip to content

GitHub Integration

Csongor Zih edited this page Aug 19, 2022 · 1 revision

Loading and saving project from GitHub β

If you are working on a version controlled project and use GitHub, you may not want to export and import JSON project files each time you modify something in wtherion. Instead, wtherion provides a GitHub integration where you can load your JSON project files directly from a GitHub repo, make changes to them, and make a commit with your changes. You don't ever have to leave the web or use any third-party git software.

Set up the integration

To authorize wtherion to make commits to repos on your behalf, and to read private repos, you need to provide a Personal Authentication Token from GitHub. Create a new one here:

https://github.com/settings/tokens/new

You will need to select the repo scope, and give any expiration date you wish. You do not need to change anything else.
Repo scope screenshot

When you have generated your token, copy it to the clipboard. Then, go to wtherion, select main menu > Configuration and enter your token under GitHub token.

Now you can edit any file from any of your repos.

Save a new project to GitHub

This is still a work in progress. You can use the GitHub > Commit new file option to do this.

Load a file from GitHub

First, find the file you wish to load on the GitHub web interface. You can load either TH2 and JSON project files. Copy the URL of the file on GitHub. It will look roughly like this:

https://github.com/daem-on/wtherion/blob/master/versionconfig.json

Please note that the branch you view on GitHub will be the branch your commit will be on.

If your URL does not include /blob/, you did not select a file. Copy the URL of the actual file you want to edit, not the directory.

Use GitHub > Load from GitHub and enter the URL you copied.

Commit changes

After you have loaded a file and made changes, the GitHub > Commit option will become available. Use it to commit the changes you made to the GitHub repo. You can enter a custom commit message when making a commit.

Please note that if changes to the same file have been made on the origin (on GitHub) the file you have will be outdated, and your commit may fail. This prevents you from overriding somebody else's changes with a commit from a different base. You should use another method to merge the changes together, or discard your version.