How to setup Sturdy with GitHub

It's easy to add existing GitHub repositories to Sturdy. With a few clicks, you can install Sturdy on as many repositories as you want. Sturdy for GitHub is a fully-featured version of Sturdy that runs on top of your existing Git repository.

  1. In the Sturdy App: Click on the three dots icon in the top left corner and select "Settings"
  2. Go to the GitHub-tab
  3. Follow the instructions to authenticate with GitHub, and install the Sturdy GitHub-application on the repositories that you want to use Sturdy with
  4. You will be redirected back to Sturdy
  5. On Sturdy, under the GitHub-tab, you'll now see the list of repositories that you can install Sturdy on
  6. Find the repository that you want to use, and click "Setup"
  7. After a few seconds, the codebase will be ready. Click "Open" to open the codebase in Sturdy
  8. To edit your code, follow the "How to: edit code" guide

Once you have the repository in a Sturdy codebase, all of the latest code as well as the history will be available within Sturdy. The file is nicely rendered and you can browse files and folders, just as you are used to.

Sturdy runs on top of the repository, and will automatically keep itself updated. Whenever new code is pushed to the default branch (main/master/etc) on GitHub, by your or somebody else, Sturdy will keep itself up to date automatically.

ℹ️ The newly created Sturdy codebase is also aware of your existing pull requests, which will be imported and show up as draft changes.

Coming soon: Pull requests created by others on your team will also show up as draft chagnes so that you can get the code with one click. This will work even if others on the team are not using Sturdy.

Source of truth

When GitHub repositories are connected to Sturdy, this is more than just an import at a point in time. Connected repositories can be configured in multiple ways:

  1. GitHub as the source of truth — In this mode, Sturdy will follow changes happening on GitHub. Changes made in Sturdy are merged through GitHub pull requests. When pull requests are merged on GitHub, they will automatically be synced to Sturdy. This works even when changes are made outside of Sturdy. In this mode, some team members can develop through Sturdy without affecting others who use GitHub directly.
  2. Sturdy as the source of truth — In this mode, the state on GitHub follows Sturdy. After a change is shared on Sturdy, it will be pushed to the HEAD branch on GitHub. Changes made directly on GitHub will not be synced to Sturdy. In this mode all development happens through Sturdy.
  3. Disabled — The connection can be disabled, in which case the copy of the code on Sturdy and GitHub will diverge.

By default, connected repositories use GitHub as the source of truth.