Skip to main content

Introduction

Understand and use Git with Pantheon.


Pantheon provides industry standard version control with Git. Pantheon uses Git to make sure all code is stored, versioned, and deployed both safely and predictably. We also give you the power of feature branching through Multidev.

Git is an open source version control system. It’s fast, secure, and reliable, and supports both simple versioning or complex, distributed, non-linear workflows for hundreds of contributors.

Every Pantheon website comes with a preconfigured container that stores your Git repository so your code and history are always available.

Git Workflow

Git is the version control tool at the heart of the Pantheon WebOps

workflow. It's a good way to streamline your website operations if you like to develop locally. You can develop locally, commit, and push to master to deploy code into your Pantheon Development environment.

You can use the connection information in your dashboard and copy it into your terminal to clone the repository to your local environment. This also syncs your local with the remote version of the code. All changes you make are periodically committed locally and pushed to the remote.

Git allows you to create a parallel version or branch of your current codebase and maintain the current version while you build the new one. This is useful if you're working on more than one version of the code, for example both the current and future version of your website.

You can push this new version of your website to the Pantheon platform, and then build an environment around it with Multidev.

Your changes are sent up the pipeline to your Live environment when you commit. Git allows you to quickly revert changes without the risk of restoring the entire environment from a backup if a bug makes it past your automated testing.

Build and Deploy Terminology

Build and deploy are terms you'll encounter frequently. Your application goes through a build and deploy process every time you push a change to your repository through Git or activate an environment.

The build process runs before deploy and scans configuration files in your repository and assembles the necessary containers. The build then prepares your application, including:

  • Compiling
  • Linking
  • Uploading artifacts

The deploy process uses the build containers to create an updated version of the live application.

More Resources