Managing your Drupal code with version control
Now that we have a Drupal code base, it is time to put that code into version control with Git. We will also export our Drupal site’s configuration to YAML files that allow us to track the site configuration in version control.
Tracking your code in version control makes it easier to collaborate with other developers, track changes, and integrate with continuous integration and deployment tools. It is highly recommended, even if you are the only developer working on the project.
Getting ready
This recipe requires that you have Git on your machine. If you do not already have Git, see the following resources:
- Git official downloads page: https://git-scm.com/downloads
- GitHub’s Install Git guide: https://github.com/git-guides/install-git
How to do it…
- Open a terminal and navigate to your Drupal code base.
- Initialize a new Git repository with the
init
command:git init
You will...