Build and customize
Save your code to GitHub
Connect your GitHub account, create a repository for your project and send your latest code to it with one button, so you keep your own copy.
You can keep a copy of your project's code in your own GitHub account. eComGear creates a new repository for the project and sends your latest saved version to it whenever you select Commit to GitHub.
This is useful if you want a backup you control, if a developer will work on the code, or if you want to move the project elsewhere later.
What you need
- A GitHub account.
- A project that has been built at least once, so there is code to send.
- Permission to edit the project.
The Git section has no plan lock.
Where to find it
You can open it two ways.
- In the editor, open More actions, then Connect GitHub.
- Or open More actions, then Project settings, and choose Git in the left menu under This Project.
Both lead to a page titled GitHub, with two cards: Account and Repository.
Step 1: Connect your GitHub account
- On the Account card, select Connect GitHub. The button changes to "Redirecting…".
- GitHub opens and asks you to allow eComGear. Review what it asks for, and approve it if you agree.
- You come back to the Git page with the message "GitHub account connected: name a repository below to save your project."
The Account card now says "Connected as" followed by your GitHub user name.
The connection belongs to you, not to the project. Once connected, you can use it from any project you can edit.
Step 2: Create the repository
A repository is the folder on GitHub that holds your code.
- On the Repository card, type a name in Repository name, for example "my-shop-website". Use a name you do not already have on GitHub.
- Choose Visibility.
| Visibility | Who can see the code |
|---|---|
| Private (the default) | Only you and people you invite on GitHub. |
| Public | Anyone on the internet. |
- Select Create & Connect.
The button shows "Creating…". Then you see "Created {name}: uploading your code…", followed by "Uploaded {number} files to GitHub". Your first upload has gone through.
The card now says "Linked to" the repository name and its branch.
One project, one repository
The repository is created just for this project. eComGear only ever sends code to that repository. It never touches any of your other repositories on GitHub.
Step 3: Send new changes
After you change your site, send the new version.
- Open the Git page again.
- Select Commit to GitHub. The button shows "Committing…".
- A message confirms: "Committed {number} files to GitHub".
- Select View commit on GitHub to see it.
Each commit sends the latest saved version of your project. If the agent is in the middle of a run, wait for it to finish first so you send the finished version.
Keep secrets out of your code
Do not write keys or passwords into your pages. Keep them in Secrets, which are not part of your code. See Store keys and secrets safely. If you choose Public, treat everything in the repository as published.
Disconnect GitHub
- Open the Git page.
- On the Account card, select Disconnect.
You see "GitHub account disconnected." eComGear removes the access it stored for your GitHub account. To be sure, you can also remove eComGear from the authorized apps in your GitHub settings. The link to your repository is remembered, so if you connect again you can carry on where you left off. Your existing repository on GitHub is not deleted.
If something goes wrong
| What you see | What to do |
|---|---|
| "Failed to connect GitHub account" | Try Connect GitHub again. Make sure you approve the request on GitHub. |
| "Failed to create repository" | The name may already be used, or contain characters GitHub does not accept. Choose another name. |
| "Repository created, but the initial code upload failed" | The repository exists and is linked. Select Commit to GitHub to send the code again. |
| "No revisions found: generate the project first." | Build the site with the agent first, then commit. |
| "No files found in the latest revision." | Ask the agent to build or restore the site, then commit again. |
| "Commit failed" | Wait a moment and try again. If it repeats, select Disconnect, connect again, and retry. |
| "Not authenticated" | Sign in to eComGear again. |
| The Repository card is missing | Your GitHub account is not connected yet. Complete Step 1. |
Related pages