Skip to content

Latest commit

 

History

History
157 lines (95 loc) · 6.79 KB

dev_install.md

File metadata and controls

157 lines (95 loc) · 6.79 KB
group subgroup title menu_title menu_order menu_node redirect_from functional_areas
installation-guide
T_Developer
(Contributor) Clone the Magento repository
(Contributor) Clone the Magento repository
1
parent
/guides/v1.0/install-gde/install/composer-clone.html
/guides/v2.0/install-gde/install/composer-clone.html
/guides/v2.0/install-gde/prereq/composer.html
Install
System
Setup

{: .bs-callout .bs-callout-tip } Totally lost? Need a helping hand? Try our [installation quick reference (tutorial)]({{ page.baseurl }}/install-gde/install-quick-ref.html) or [installation roadmap (reference)]({{ page.baseurl }}/install-gde/install-roadmap_part1.html).

Intended audience {#integrator-aud}

The audience for this topic is anyone who contributes to the {{site.data.var.ce}} codebase. You should be highly technical, understand {% glossarytooltip d85e2d0a-221f-4d03-aa43-0cda9f50809e %}Composer{% endglossarytooltip %} and Git commands, and be able to upgrade the Magento system software and extensions using those commands. If that isn't you, go back and choose another starting point.

{: .bs-callout .bs-callout-warning } If you clone the Magento 2 GitHub repository, you cannot use the Magento software in a production environment. You cannot have a live store that accepts orders and so on.

Prerequisites

{% include install/prereq.md %}

{% include install/composer-overview.md %}

Install Composer {#instgde-prereq-compose-install}

{% include install/composer-clone.md %}

Clone the Magento repository {#instgde-prereq-compose-clone}

This section discusses how to get current code by cloning the Magento GitHub's develop branch. You can clone either a release branch or the develop branch:

  • Release branches like 2.1.0 are more stable

    You must use a released branch with the Data Migration Tool.

  • develop is more recent

Currently, the develop branch is the default but you can checkout a release branch like 2.1.0 after cloning.

Creating an authorization file {#instgde-prereq-compose-clone-auth}

The Magento 2 GitHub repository requires you to authenticate. The composer install commands fails if you do not. To authenticate, generate authentication keys, after which you create an auth.json file in the home directory of the {% glossarytooltip 5e7de323-626b-4d1b-a7e5-c8d13a92c5d3 %}Magento file system owner{% endglossarytooltip %}.

Create auth.json

{% include install/auth-json.md %}

How to clone the Magento 2 GitHub repository {#instgde-prereq-compose-clone-ways}

You can clone the Magento 2 GitHub repository using either SSH or HTTPS protocols:

  • Use SSH for better security (no username and password are exchanged). This requires you to share a public key with GitHub.
  • Use HTTPS if you don't share an SSH key with GitHub (your username and password are encrypted before being sent to GitHub).

See one of the following section:

Clone with SSH {#instgde-prereq-compose-clone-ssh}

To clone the Magento GitHub repository using the SSH protocol:

  1. Copy to the clipboard the Magento GitHub repository SSH clone {% glossarytooltip a05c59d3-77b9-47d0-92a1-2cbffe3f8622 %}URL{% endglossarytooltip %}.

    a. In a web browser, go to the Magento GitHub repository.

    b. On the right side of the page, under the clone URL field, click SSH.

    c. Click the Copy to clipboard button.

    The following figure shows an example.

    Clone the Magento GitHub repository using SSH

  2. Change to your web server's docroot directory. Typically, for Ubuntu, it's /var/www or /var/www/html and for CentOS it's /var/www/html.

    Need help locating the docroot? Click here.

  3. Enter git clone and paste the value you obtained from step 1.

    An example follows:

    git clone git@github.com:magento/magento2.git
    
  4. Wait for the repository to clone on your server.

    If the following error displays, make sure you [shared your SSH key](https://help.github.com/articles/generating-ssh-keys/){: target="_blank"} with GitHub: ```terminal Cloning into 'magento2'... Permission denied (publickey). fatal: The remote end hung up unexpectedly ```
  5. Optionally switch to a release tag as follows:

    git checkout tags/<tag name> [-b <version>]
    

    For example, to check out the 2.1.0 release tag in a new branch named 2.1.0, enter

    git checkout tags/2.1.0 -b 2.1.0
    
  6. Continue with Update installation dependencies.

Clone with HTTPS {#instgde-prereq-compose-clone-https}

To clone the Magento GitHub repository using the HTTPS protocol:

  1. Copy to the clipboard the Magento GitHub repository HTTPS clone URL.

    a. In a web browser, go to the Magento GitHub repository.

    b. On the right side of the page, under the clone URL field, click HTTPS.

    c. Click the Copy to clipboard button.

    The following figure shows an example.

    Clone the Magento GitHub repository using HTTPS

  2. Change to your web server's docroot directory.

    Typically, for Ubuntu, it's /var/www or /var/www/html and for CentOS it's /var/www/html.

  3. Enter git clone and paste the value you obtained from step 1.

    An example follows

    git clone https://github.com/magento/magento2.git
    
  4. Wait for the repository to clone on your server.

  5. Optionally switch to a release tag as follows:

    git checkout tags/<tag name> [-b <version>]
    

    For example, to check out the 2.1.0 release tag in a branch named 2.1.0, enter

    git checkout tags/2.1.0 -b 2.1.0
    

Next step

After completing the tasks discussed on this page, see Update installation dependencies.

*[contributing developer]: A developer who contributes code to the Magento 2 CE codebase *[contributing developers]: Developers who contribute code to the Magento 2 CE codebase