Daniel TurtonSome of our customers have asked us for advice on the best practices for using WP Engine’s Git Push feature.

Daniel Turton, one of our Support Reps, was kind enough to share his Top 4 Tips for Using Git Push.

Should I Appoint a Single Repository/Branch Maintainer?

We recommend you consider appointing a Repository/Branch Maintainer—this person will be responsible for pushing the data up to the Git Push point.

Designating a Repository/Branch Manager will help to avoid merge conflicts at the push point, because only one person will then have the ability to push to WP Engine.

Diagram demonstrating Git Push workflow

Layout for Data Flow within WP Engine

Should I Still Use BitBucket/GitHub?

GitHub and BitBucket still have their place under many conditions. For example, GitHub and BitBucket continue to be helpful if your team has decided to develop with a central repository in your organizational structure.

Similarly, if you need part of the project to be accessible to the public—or to people that don’t need to make changes to the site—keep using BitBucket/GitHub. Access to Git Push for your site should not be granted freely, because it’s best to keep the number of people who can push changes to the site to a minimum.

WP Engine’s Git Push point was not designed to replace GitHub or BitBucket, so it’s best not to use it for these functions.

Should I Use Private Submodules?

The WP Engine Git Push system was designed to work with publicly accessible submodules. It’s unable to authenticate for SSH-based connections to services like GitHub and BitBucket.

If you need to use data from private submodules, consider bringing them into your project as subtrees. Subtrees don’t require communication with the private repository after the commit has been pushed to WP Engine.

A submodule, on the other hand, will require communication with the private repository to supply data when pushed. This link can provide you with more information on Git subtrees.

Should I continue to use Secure FTP to manage my files?

Since you’re now using Git Push to move your versioned content onto the site, it’s best to avoid making changes to tracked files. This is because they are replaced by what is kept within your repository on every push.

If changes are being made to those tracked files—and you would like to keep track of them within your repository—feel free to download them via SFTP, then commit them locally.

Top 4 Tips for Git Push

There you have it—Daniel’s Top 4 Tips for using WP Engine’s Git Push!

To sum up:

  1. Designate a single repo/branch maintainer.
  2. Keep using BitBucket/GitHub if (1) you develop with a central repository or (2) you need to provide outside access.
  3. Use subtrees to bring data from private submodules into your project.
  4. Keep SFTP usage to a minimum to avoid file conflicts.

Are there any other WP Engine features you’d like us to publish a best practice guide for?