Once you've used Git Integration & Wix CLI to edit your site's code and test it, you're ready to move it to your live site. This process includes 2 stages:
Your site's editor is synced with the default branch of your site's GitHub repository. Usually, this is the main
branch, but you can change it to any branch you want.
To sync your code with the editor, push a commit to your repo's default branch. You can use other GitHub features like branches, pull requests, and reviews as you normally would.
Once you push a commit to your default branch, your code appears in the editor. The commit details appear in the GitHub Integration panel of the Velo Sidebar (Wix Editor), or in the Github section of the Code sidebar (Wix Studio).
Note: There may be a delay between when you push a commit to GitHub and when it appears in the editor.
When working with Git Integration & Wix CLI, you can publish your site either from the editor or from the Wix CLI. The different publishing options use different copies of your site's code and different UI versions, as follows:
Publishing Method | Code Version | UI Version |
---|---|---|
editor | The code in the default branch of your site's repo. | The latest UI version, even if this version doesn't align with the code in your site's repo. |
CLI - Latest commit | The code in the default branch of your site's repo. | The UI version indicated in the wix.config.json file in your site's repo. |
CLI - Local code | The code saved in your IDE even if you haven't pushed it to GitHub. | The UI version indicated in the wix.config.json file in your site's repo. |
To publish your site from the editor do the following:
Open the editor.
Click Publish.
Note that a modal may appear warning you that you are about to publish the latest UI version. Click Continue.
To publish your site from the Wix CLI, do the following:
Open your terminal and navigate to your site's repo.
Run this command: wix publish
.
When you publish from the CLI, you can either use the code in your repo's default branch, or the code saved in your IDE.
To publish from your default branch, select Latest commit from {your repo's default branch}
.
To publish from the code on your local computer, select Local code
.
Important:
Publishing your local code leaves your live site and your site's GitHub repo out of sync. If you publish from the repo later without pushing your local code, your local code is overwritten and may be lost.
Once you make a selection, the source of the code and UI version that are being used to publish are displayed in the terminal. A link to a preview site is also displayed. If you're sure you want to publish, press y
.
The terminal displays the URL of your published site and links to view logs and backend traffic.