- Open the terminal app (or the terminal in VS Code) and change to the root site directory of the site you are updating
- Switch to the main branch and fetch the latest changes
git checkout master git fetch --all git pull
- Create a new branch from the main branch for the Drupal core update
git checkout -b update/core-[version]
- Update Drupal core (use the php that comes with XAMPP)
/Applications/XAMPP/xamppfiles/bin/php /usr/local/bin/composer update drupal/core --with-dependencies
- IMPORTANT! Check the release page if there has been changes made to the .htaccess file. Since most sites are customized, discard the changes to retain the current changes
git checkout web/.htaccess
- Open your browser and login to the Drupal admin dashboard.
- Navigate to yoursite.com/update.php and press the continue button
- IMPORTANT! Check if there are database update. If there are database updates, make sure to backup the database first!
- Click the link to go back to the Administration pages and navigate to Report -> Status report page and make sure the site has updated correctly.
- Find and remove and other .git repositories in the repo. Only keep the one in the root directory.
find . -type d -name .git
rm -Rf ./vendor/drupal/[project]/.git
- Add and commit the changes and included a message with "Updated to [version]"
git add . git commit -m "Updated Drupal core to [version]"
- Switch back to the master branch and merge the update branch to the main branch and push it to the repository.
git checkout master git merge update/core-[version] git push