1 of 18

WordPress & Git

2 of 18

Intro

  • My name is Treighton
  • Developer @ Page Design Group
  • I work mostly in PHP building plugins and custom functionality for WordPress sites.
  • You can find me online twitter @treighton1988
  • I am not a designer as you can probably tell by my slides (sorry…)

3 of 18

Caveats

  • There is no “One true path” for using git with WordPress.
  • The workflow presented is Page Design Group’s actual workflow
  • You are free to use this workflow or modify it to better suit your team.

4 of 18

What is git?

Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.

-Source https://git-scm.com/

5 of 18

Why use git?

  • Track Changes, when they happened, and who made them.
  • Revert to different versions if needed
  • Develop in parallel using branches
  • Easier to collaborate with Other Developers

6 of 18

Why is git different with WordPress?

It isn’t really that much different...but there are some unique difficulties.

7 of 18

Brief Tutorial (what i will cover)

  • Setup (installing git & local repo)
  • GUI vs CLI (Github, Sourcetree, Git Kraken)
  • Determining what to commit (setting up .gitignore, config-local.php)
  • Creating remote repositories (github, gitlab, bitbucket)
  • Dealing with the DB (useful plugins, SQL Queries)
  • Basic Git commands (Clone, Branch, Stage, Commit)

8 of 18

Setup (for projects without a repo)

  1. Install git. https://git-scm.com/download
  2. Move to your project folder, and initialize a local git repository

9 of 18

Setup (cloning from existing repo)

  • Install git. https://git-scm.com/download
  • Move to where you want the project cloned to, and and use the command git clone

10 of 18

What to commit / .gitignore

11 of 18

Local & Production config.php

12 of 18

Local & Production config.php

13 of 18

Remote Repositories

14 of 18

Linking local and remote together

git remote add origin {link to remote repo}�git add .�git commit�git push -u origin master

15 of 18

Basic Git Commands

git clone�git init�git add .�git commit�git push <remote> <branch>

16 of 18

“you need to git up, git out and git somethin”

- From an expert (OutKast)

17 of 18

Q&A

18 of 18

Page Design Group

1900 29th st

Sacramento, CA 95816

Treighton@pagedesigngroup.com