Git for versions
Use Git branches to create different versions of the site.
LumeCMS can execute git operations in your filesystem like commit, push, pull and manage branches. This is useful to create different versions of the site. To enable Git with the default options use the git()
function:
cms.git();
Important
Keep in mind that the Git integration needs your changes saved in local files. If you're using github or other storage methods that don't use the filesystem (like databases, etc) these changes won't be managed by git.
The available values are:
- prodBranch: The production branch. By default is
main
. - prefix: A prefix for the the branches of other versions. By default is
lumecms/
. A version namedv2
is stored in the branchlumecms/v2
. - command: The command to invoke git. By default is
git
. - remote: The name of the remote repository to push and pull changes. By default is
origin
.
cms.git({
prodBranch: "master", // Change the production branch
});