Source in git
Each Site has its own repository on Fluid’s GitHub, namedsite-<id>. A new Site’s repository starts from the main branch of the public member-site-template. The repository is the record of what you published and a way to get a Site’s code onto another machine.
fluid sites publish and fluid deploy save the source before they upload the build:
- The CLI asks Fluid for a short-lived credential for the Site’s repository.
- It commits the folder and pushes it to the repository’s
mainbranch. A publish to a branch pushes to a git branch named after the branch’s slug. - Then it uploads and publishes the build. A push that fails publishes nothing.
.env, .env.* (such as .env.local), .envrc, .npmrc, .member-site.json, node_modules and the build folder. Everything else in the folder is committed. A file such as secrets.json or .env-secret isn’t left out, so keep secrets out of the folder.
The source isn’t saved when:
- you pass
--no-source; - Fluid can’t set up the Site’s repository. The command says so and publishes without the source, and a later publish saves it;
- the server doesn’t offer source saving. The command says so and publishes without it.
Pull a Site’s source
fluid sites pull clones a Site’s source into a new folder and binds the folder to the Site, so fluid sites publish runs there:
--branch <slug> clones the Site’s branch instead. A Site whose source was never saved has nothing to clone.
Branches
A branch is a private copy of a Site, with its own address, to publish to and check before the Site itself changes. A Site has at most one branch. Only the Site’s owner and company admins open it, and search engines never index it.fluid sites publish --branch <slug>publishes the folder to the branch. The Site itself doesn’t change.fluid sites branch deletedeletes the branch and its own Site. It asks first, and--yesskips the question. The Site itself doesn’t change.- A branch of a Site with a database gets its own copy of the database. See Branches on the database page.