Pull code from a private Git repository

Your Magento Enterprise Cloud Edition project can include code located in a private Git repository (for example, a module or theme). To do so, you must add your project’s public SSH key to your private Git repository and update your project’s composer.json.

To add a deployment key to your private GitHub repository, you must be the administrator of that repository.

GitHub allows you to use a deploy key for one repository only.

If your project needs to access multiple repositories, you can choose to attach an SSH key to an automated user account. Because this account won’t be used by a human, it’s referred to as a machine user. You can then add the machine account as collaborator or add the machine user to a team with access to the repositories it needs to manipulate.

Find your deploy key

To find your project SSH public key (also referred to as a deploy key):

  1. Log in to your project using the Web Interface.
  2. Click Configure Project.
  3. Click Deploy Key.

    The following figure shows an example.

    Deploy Key

  4. Copy the deploy key to the clipboard.
  5. See Enter your GitHub deploy key.

Enter your GitHub deploy key

By default, on github, deploy keys are read-only, so you do not need to worry about anything from your Magento project pushing code to the private repository.

To enter your project’s public key as a GitHub deploy key:

  1. Log in to your GitHub repository as its administrator.
  2. Click Settings as the following figure shows.

    GitHub settings

    If you don't see this option, you're not the repository administrator and you cannot complete this task. Ask your GitHub project administrator to do this.

  3. On the Settings page, in the left navigation bar, click Deploy Keys as the following figure shows.

    GitHub deploy key

  4. Click Add deploy key.
  5. Follow the prompts on your screen to complete the task.

In composer.json, use the <user>@<host>:<.git</code> format, or ssh://<user>@<host>:<port>/<path>.git if using a non-standard port.</p> </div>