Clone the git repository
You can clone the latest code from the Magento Open Source GitHub repository, and use code from a release branch or a development branch.
A release branch is a stable, full-featured code branch officially released with a version number, such as 2.4. You must use a release branch with the Data Migration Tool.
A development branch, or feature branch, is a less-stable code branch with the latest code intended as the next version or to introduce a specific feature.
You can checkout a specific branch after you clone the repository to your local development environment. See Cloning a repository in the GitHub Docs.
Authentication and access
The Adobe Commerce repository requires authentication, so you must prepare the following:
Authentication key—You must have an authentication key to access the Adobe Commerce Composer package on
repo.magento.com
and to enable install and update commands for your project.GitHub personal access token—Composer requires a personal access token in the
github-oauth
property to authorize GitHub repository access. When you create this token, select all options in therepo
scope.
Authentication file
You must create an auth.json
file that contains your Adobe Commerce authorization credentials in the Magento root directory.
To create an authentication file:
If you do not have an
auth.json
file in your Magento root directory, create one.- Using a text editor, create an
auth.json
file in the Magento root directory. - Copy the contents of the sample
auth.json
file into the newauth.json
file.
- Using a text editor, create an
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.Copied to your clipboard{"http-basic": {"repo.magento.com": {"username": "<public-key>","password": "<private-key>"}},"github-oauth": {"github.com": "<personal-access-token>"}}Save your changes and exit the text editor.
Pushing an auth.json
file to a public repository can expose your credentials.
After completing the tasks discussed on this page, see update installation dependencies.