On this page
Connect GitHub and Swarmz creates a private repository under your account, pushes your project's code to it and keeps the two in sync. Changes you make in Swarmz are pushed to GitHub, and changes you push to GitHub come back into the project. It is also how you take a full copy of your code with you.
Connect a project to GitHub#
Step 1: Open the Git settings
In your project, click Tools, then Settings, then Git. The page says "Connect your GitHub account, then create or link a repository for this project."
Step 2: Click Connect
GitHub opens in a popup so you can sign in and approve access. Allow popups if your browser blocks it. When you return, Swarmz shows "GitHub connected".
Step 3: Name the repository
The Create GitHub repository box suggests a name based on your project. Change it if you like, or use Regenerate name. The box shows "Will create" and the full name, marked as private. It must use only letters, numbers, hyphens, dots and underscores, and the name must not already exist on your account.
Step 4: Click Create repository
Swarmz creates the repository and pushes your code as the first commit. When it finishes, the page shows the repository, its branch and "Auto-syncs on edits and external pushes". Click View to open it on GitHub.
How the sync works#
- Swarmz to GitHub. Edits you make in Swarmz are pushed to the repository automatically.
- GitHub to Swarmz. Commits pushed to the linked branch come into your project.
- Restores. When you restore an earlier version, Swarmz pushes the restored code to GitHub too.
- Pushing to GitHub does not by itself change your live site. To put changes live, use Publish changes to your live app.
Open your code#
From the project menu, the GitHub entry shows the linked repository with Open in GitHub, Open in VS Code (the browser editor) and Manage. If the project is not linked, it offers Connect to GitHub.
Manage all your GitHub connections#
In your dashboard settings, open Git. You see your connected account, which projects use it and when each repository last synced. Add connection links another account, Reconnect refreshes a link that stopped working and Disconnect removes the account.
If something goes wrong#
- Reconnection required. Your GitHub token was revoked or expired. Click Reconnect to resume sync.
- The repository was not created. Pick a different name, check your GitHub account allows new repositories, and try again.
- Initial push failed. Swarmz says the repo was created but the push failed. Edit a file in your project and it will sync automatically.
- Sync is paused. If you see "GitHub sync is temporarily disabled", linked repositories are not affected. Syncing resumes when it is available again.
Unlink a repository#
On the same Git page, click Unlink under Unlink repository. This disconnects the project from GitHub. Files and history are preserved, and the repository is not deleted. You can link again later.
Good to know#
- The repository is created under your own GitHub account and starts private.
- Anyone with write access to the repository can push changes into your project, so manage access in GitHub.
- GitHub is the way to take your code out of Swarmz today. See Take your code with you.
- Starting a new Swarmz project from an existing repository is not available yet. See Import a project from GitHub.
Common questions#
Can I edit the code on my computer?
Yes. Clone the repository, make your changes and push them to the linked branch. They come into your project through the sync.
Is my GitHub password stored?
No. You sign in at GitHub and approve access. Swarmz keeps an access token, which you can revoke from your GitHub settings.
Was this helpful?
Related articles
Import a project from GitHub
Importing an existing GitHub repository as a new Swarmz project is not available yet. Here is what you can do today.Take your code with you
Your code is yours. Sync it to your own GitHub repository to keep a copy or work on it elsewhere.In Privacy, security and safetyDisconnect an integration
Remove a connected service, or reconnect one that stopped working, and what happens to the projects that use it.Restore an earlier version
Every change Swarmz makes is saved as a version. Preview any version live and restore it in one click.In Building with Swarmz
Still have a question?
Ask about this article, or talk to a person.