-
Log in to your local development machine, or switch to, the [Magento file system owner]({{ page.baseurl }}cloud/before/before-workspace-file-sys-owner.html).
-
Change to a directory to which the Magento file system owner has write access, such as the web server docroot.
-
Log in to your project:
magento-cloud login
-
List your projects:
magento-cloud project:list
-
If necessary, clone a project.
magento-cloud project:get <project ID>
Typically, you should clone the project in the web server's docroot or a Virtual Host docroot.
-
Change to a project directory.
For example,
cd /var/www/html/magento2
-
List environments in the project:
magento-cloud environment:list
magento-cloud environment:list
displays environment hierarchies whereasgit branch
displays does not. If you have any nested environments, usemagento-cloud environment:list
. -
Fetch origin branches:
git fetch origin
-
Check out an environment:
magento-cloud environment:checkout <environment ID>
To create a new environment, use
magento-cloud environment:branch <environment name> <parent environment ID>
-
Pull updated code:
git pull origin <environment ID>
-
Create a snapshot of the environment.
magento-cloud snapshot:create -e <environment ID>