Git

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 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.

Not everyone remembers Git commands with ease. If you want a Git client, use any client of your choice. Some developers use clients including GitKraken and SmartGit.

Git branch naming

In addition to Git’s requirements for valid branch names, Magento Commerce Cloud adds two additional requirements:

  • The / 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 Sprint2 and sprint2 are just fine.

Git branching

For specifics on creating Git branches, see the following topics:

.gitignore file

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 .gitignore reference.

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.

Git integrations

We support using either GitHub or Bitbucket integrations for your Magento Commerce Cloud project.

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.