Git is the center of all code management, build, and deployment for your Magento Commerce Cloud stores and sites. We use Git to provide source control for your code:
- Git supports branch development that merges upstream (or to a parent branch) before deploying across your environments. Multiple developers can work together on small to large code updates through Git branch management.
- When you push Git branches, we automatically kick off build and deploy scripts to completely build and verify your code, generate and update a virtual environment, and deploy to the environment for ease of testing.
- Every active Git branch has an associated environment. We use specific .yaml files in Magento Commerce Cloud code with your customizations to define environment configurations, services, database, and more.
If you need help understand Git, you can review the following resources:
- Git documentation and videos from the makers of Git
- Git cheatsheet and quick guide from Roger Dudler
- Git video with DevForge to understand how people use the repo and commands with a fun story
Git CLI and clients
You can interact with Git using CLI commands or using a Git client. Git provides a Git client option, or you can use other clients such as installed on your computer to be able to interact with Magento Commerce Cloud.
Git branch naming
In addition to Git’s requirements for valid branch names, Magento Commerce Cloud adds two additional requirements:
/character isn’t allowed in a branch name.
- Branch names must be case-insensitively unique. In other words, the names must be entirely unique regardless of the case you use. For example, if you have a branch named
Sprint, you cannot create another branch named
sprint. A branch name of
sprint2are just fine.
For specifics on creating Git branches, see the following topics:
Depending on your Magento Commerce Cloud version, you may need different information added to or commented out in your
.gitignore file. Git uses this file to determine which files and directories to ignore, before you make a commit to your branches. A .gitignore file should be committed into your root Magento in the repository, in order to share the ignore rules with any other users that clone the repository.
We include a base
.gitignore file with the project repository. For a review of the Magento Commerce Cloud file, see .gitignore file. You can review the recommended files for your file in the
Git and SSH
You must use Secure Shell (SSH) and not HTTPS to connect to the Git repository. For more information, see GitHub documentation.
When setting up your SSH, review our information at SSH and sFTP.
To integrate other git repositories with your Magento Commerce Cloud project using Github or Bitbucket deploy keys, refer to Pull code from a private Git repository.