Follow the steps below to clone Magento2 official git branch.
STEP 1: Clone the repository
You can clone the latest code from the Magento GitHub repository
STEP 2: Create an authentication file
- Create an
auth.json
file in your Magento root directory. - Copy the contents of the sample
auth.json
file into the newauth.json
file. - Replace
<public-key>
and<private-key>
with your Adobe Commerce authentication credentials. Add thegithub-oauth
section and replace the<personal-access-token>
with the one you created for your GitHub account.
{
"http-basic": {
"repo.magento.com": {
"username": "<public-key>",
"password": "<private-key>"
}
}
"github-oauth": {
"github.com": "<personal-access-token>"
}
}
STEP 3: Install composer dependencies by running the below command.
composer install