Create a branch for development
After cloning your project and updating the Adobe Commerce administrator account configuration, you can branch for development. As stated earlier, you must create an environment using the magento-cloud environment:branch <branch-name>
command or the Cloud Console for the environment to become active.
To create a development branch:
-
On your local workstation, change to your project directory.
-
Create an environment based on the branch recommended for your project workflow.
magento-cloud branch <new-environment-name> integration
-
Update dependencies.
composer --no-ansi --no-interaction install --no-progress --prefer-dist --optimize-autoloader
-
[optional] Create a backup of the environment.
Merge a branch
After completing development, merge this branch to the parent:
-
Commit and push code changes:
git add -A && git commit -m "Add message here"
git push origin <branch-name>
-
Merge with the parent environment:
magento-cloud environment:merge <environment-ID>
Delete an environment
Only delete an environment if you are certain that you no longer need it. You cannot recover an environment after you delete it.
master
branch of any project.You must be a project administrator, environment administrator, or Account Owner to perform this task. See Manage user access to Cloud projects.
When you delete an environment, the environment is set to inactive. The code is still available in the Git branch, but no longer contains the services or the database. To delete the environment completely, you must also delete the corresponding remote Git branch.
To delete an environment:
-
On your local workstation, change to your project directory.
-
Fetch updates from the remote server.
git fetch
-
Delete the environment branch.
magento-cloud environment:delete <environment-ID>
Optionally, you can delete more than one environment at a time by adding multiple environment IDs to the delete command.
magento-cloud environment:delete <environment-1-ID> <environment-2-ID>
-
Respond to the prompts to delete the local environment and the corresponding remote environment.
The environment <environment-ID> is currently active: deleting it will delete all associated data. Are you sure you want to delete the environment <environment-ID>? [Y/n]
Deleting the environment places it in an inactive state.
Delete the remote Git branch too? [Y/n]
Deleting the remote Git branch removes the environment from the project.
-
Wait for the environment to delete.
Deleting environment <environment-ID> Waiting for the activity... Deleting environment <project-id>-<environment-ID>-xxxxxx [============================] 1 min (complete) Activity ID succeeded Deleted remote Git branch <environment-ID> Run git fetch --prune to remove deleted branches from your local cache.
magento-cloud environment:activate
command.Interact with remote environments
After you set up SSH keys, you can connect from your local workspace to a remote environment and interact with your project services and modify settings.