SlideShare uma empresa Scribd logo
1 de 31
Baixar para ler offline
WordPress  and  
                      Version  Control
                           A Workflow

                           $ Aaron Holbrook
                             A7 Web Design, Owner
                                aaron@a7web.com




Monday, June 11, 12
aaron@a7web.com

                           @aaronjholbrook

                                a7web.com


   #wcmke #wpgit

Monday, June 11, 12
overview
               Background
               Disclaimer
               Assumptions
               Local Development
               Version Control (Git)
               Using WordPress & Git together
               Deployment
               Some demos
               Ask questions!

   #wcmke #wpgit

Monday, June 11, 12
have you ever...
               Wanted to make your changes live with the push of a
               button?
               Hated dragging files into FTP and wished for a better way?
               Been editing via FTP, made a change, closed the editor
               and immediately realized you shouldn’t have closed it?
               Lost code and didn’t have a backup?
               Had a backup, but it was too old?
               Had a site become corrupt, infected or lost with no way to
               recover it?

   #wcmke #wpgit

Monday, June 11, 12
a little history
               I had 10+ WordPress sites to maintain
               Sites were similar in layout and style
               differing only by color scheme
               Needed a way to quickly push out
               changes across all the sites
               Really wanted to utilize version control

   #wcmke #wpgit

Monday, June 11, 12
disclaimer!
                          ma y vary)
                   ileage
      YMMV (your m




               This workflow is something that I’ve
               refined to suit my needs, feel free to
               adjust it to suit yours




   #wcmke #wpgit

Monday, June 11, 12
assumptions
               You’re aware of how important Version Control is,
               but have not fully integrated it into your workflow
               You have some familiarity with the command line
               Your live server environment supports SSH
                        (most hosts support SSH, sometimes you have to ask)


               You have a local development environment that
               you prefer to work within
               You’d like to have seamless, simple deployments

   #wcmke #wpgit

Monday, June 11, 12
the workflow
               Start local, develop some functionality
               Set up deployment system to your live
               server
               Deploy your changes with the press of a
               button!


   #wcmke #wpgit

Monday, June 11, 12
things you’ll need

               Terminal
               Git
               SSH




   #wcmke #wpgit

Monday, June 11, 12
legend

               Whenever you see $ command here
               Everything after the $ is what you should
               type




   #wcmke #wpgit

Monday, June 11, 12
“A civilized tool for a civilized age”
                                           - Si, stack overflow




Monday, June 11, 12
git 101

               You can define a Git repository in any
               directory simply by typing: $ git init
               Via the terminal, navigate to the root of
               your local site directory and type $ git init



   #wcmke #wpgit

Monday, June 11, 12
.gitignore
               .DS_Store
               wp-config.local.php
               .htaccess
          Optional - ignore user uploads

               wp-content/uploads/
          Optional - ignore live cache

               wp-content/cache/

   #wcmke #wpgit

Monday, June 11, 12
git 102

               In your git repo, add all files $ git add .
               Commit! $ git commit -m “Commit Message”
                Success!           -m allows an i
                                                  nline commit m
                                                                 essage




   #wcmke #wpgit

Monday, June 11, 12
Deploy
Monday, June 11, 12
this
                                                                       file
                                                                              is t


                      wp-config.local.php
                                                                                   he m
                                                                                        agic
                                                                                             key




               1. Define local variables without
                  contaminating the server
               2. Add a call to wp-config.php to check for
                  this file and load it if it exists



                                                 Credit to Mark Jaquith who came up with this idea
   #wcmke #wpgit             http://markjaquith.wordpress.com/2011/06/24/wordpress-local-dev-tips/

Monday, June 11, 12
this
                                            file
                                                   is t


                      wp-config.local.php
                                                        he m
                                                             agic
                                                                  key




   #wcmke #wpgit

Monday, June 11, 12
wp-config.php

               1. Test for   wp-config.local.php

               2. If it doesn’t exist, then use live server
                  connection information




   #wcmke #wpgit

Monday, June 11, 12
wp-config.php




   #wcmke #wpgit

Monday, June 11, 12
ssh 101

               1.     $ ssh login@server.com

               2. Enter password
               3.     success




   #wcmke #wpgit

Monday, June 11, 12
HUB & PRIME

               On the server, we will create two
               repositories
                      HUB   will be the main collaborator
                      PRIME   will be the live site repository


                                                                      Major props to Joe Maller
   #wcmke #wpgit                           http://joemaller.com/990/a-web-focused-git-workflow/

Monday, June 11, 12
hub
                                                 HUB
               Create hub as a bare repository
                      I generally put it right above the site’s html root in a ‘git-hub’* folder


                       /domains/site.com/html

                       /domains/site.com/git-hub


              $ git init --bare


                                                        * Not to be confused with the fantastic GitHub website
   #wcmke #wpgit                                                                           https://github.com/

Monday, June 11, 12
HUB hook

               We’ll want PRIME to auto-update when we
               push our changes up to H HUB

               So let’s set up a hook!




   #wcmke #wpgit

Monday, June 11, 12
HUB hook
                      /git-hub/hooks/post-update




   #wcmke #wpgit

Monday, June 11, 12
PRIME
               1. Create as regular repo
                      $ git init


               2. Add remote to       HUB
                      $ git remote add hub /domains/site.com/git-hub




   #wcmke #wpgit

Monday, June 11, 12
and finally

               Set up our local remote to                 HUB

                $ git remote add hub ssh://login@host.com/home/domains/site.com/git-hub


                 Success!




   #wcmke #wpgit

Monday, June 11, 12
3...2...1... blast off!
               Make sure that our repository is clean
                      $ git add .

                      $ git commit -am “Updated header to include nav links”

               ...wait for it...
                      $ git push hub master

               We’ve deployed!                hooray!



   #wcmke #wpgit

Monday, June 11, 12
push & pull
               Occasionally you will need to commit on
               the server and pull down to your local
               repository
               All you need to do (from local machine)
                      $ git pull hub master




   #wcmke #wpgit

Monday, June 11, 12
caution!
               The uploads folder can change quite
               frequently, which may cause your repos to
               get out of sync, necessitating a need for
               frequent pulldowns to keep repos in
               check
               Depending on situation, you can ignore
               uploads/* directory or sync repos
                /uploads/*
               frequently

   #wcmke #wpgit

Monday, June 11, 12
take away
               Start local, develop some functionality
               Set up deployment system to your live
               server
               Deploy your changes with the press of a
               button!


   #wcmke #wpgit

Monday, June 11, 12
a7web.com


                             @aaronjholbrook

                      aaron@a7web.com
   #wcmke #wpgit

Monday, June 11, 12

Mais conteúdo relacionado

Destaque

Hype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerHype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerLuminary Labs
 
Designing Teams for Emerging Challenges
Designing Teams for Emerging ChallengesDesigning Teams for Emerging Challenges
Designing Teams for Emerging ChallengesAaron Irizarry
 
Visual Design with Data
Visual Design with DataVisual Design with Data
Visual Design with DataSeth Familian
 
3 Things Every Sales Team Needs to Be Thinking About in 2017
3 Things Every Sales Team Needs to Be Thinking About in 20173 Things Every Sales Team Needs to Be Thinking About in 2017
3 Things Every Sales Team Needs to Be Thinking About in 2017Drift
 
How to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheHow to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheLeslie Samuel
 
Wordpress version control
Wordpress version controlWordpress version control
Wordpress version controlDavid Doolin
 
Developing with WordPress and Git
Developing with WordPress and GitDeveloping with WordPress and Git
Developing with WordPress and GitRob Miller
 
WordPress and Git
WordPress and GitWordPress and Git
WordPress and GitRob Miller
 
Migrating a Site Quickly with SSH and WP-CLI (It's not as scary as you think!)
Migrating a Site Quickly with SSH and WP-CLI (It's not as scary as you think!)Migrating a Site Quickly with SSH and WP-CLI (It's not as scary as you think!)
Migrating a Site Quickly with SSH and WP-CLI (It's not as scary as you think!)Japheth Thomson
 
Introduction to git & WordPress
Introduction to git & WordPressIntroduction to git & WordPress
Introduction to git & WordPressJosh Lee
 
Introducing Git to your FTP workflow
Introducing Git to your FTP workflow Introducing Git to your FTP workflow
Introducing Git to your FTP workflow Roman Rus
 
Every project is a story applying storytelling to your client interactions (1)
Every project is a story  applying storytelling to your client interactions (1)Every project is a story  applying storytelling to your client interactions (1)
Every project is a story applying storytelling to your client interactions (1)Dwayne McDaniel
 
Fictionalised biopics –
Fictionalised biopics –Fictionalised biopics –
Fictionalised biopics –lukedan33
 
BADCamp 2012- Drupal Support
BADCamp 2012- Drupal SupportBADCamp 2012- Drupal Support
BADCamp 2012- Drupal Supportmeghsweet
 
Ejercicio 9 carta
Ejercicio 9 cartaEjercicio 9 carta
Ejercicio 9 cartaaitoor1234
 
Wp cli- intro and basics
Wp cli- intro and basicsWp cli- intro and basics
Wp cli- intro and basicsDwayne McDaniel
 

Destaque (17)

Hype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerHype vs. Reality: The AI Explainer
Hype vs. Reality: The AI Explainer
 
Designing Teams for Emerging Challenges
Designing Teams for Emerging ChallengesDesigning Teams for Emerging Challenges
Designing Teams for Emerging Challenges
 
Visual Design with Data
Visual Design with DataVisual Design with Data
Visual Design with Data
 
3 Things Every Sales Team Needs to Be Thinking About in 2017
3 Things Every Sales Team Needs to Be Thinking About in 20173 Things Every Sales Team Needs to Be Thinking About in 2017
3 Things Every Sales Team Needs to Be Thinking About in 2017
 
How to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheHow to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your Niche
 
Wordpress version control
Wordpress version controlWordpress version control
Wordpress version control
 
Developing with WordPress and Git
Developing with WordPress and GitDeveloping with WordPress and Git
Developing with WordPress and Git
 
WordPress and Git
WordPress and GitWordPress and Git
WordPress and Git
 
Migrating a Site Quickly with SSH and WP-CLI (It's not as scary as you think!)
Migrating a Site Quickly with SSH and WP-CLI (It's not as scary as you think!)Migrating a Site Quickly with SSH and WP-CLI (It's not as scary as you think!)
Migrating a Site Quickly with SSH and WP-CLI (It's not as scary as you think!)
 
Introduction to git & WordPress
Introduction to git & WordPressIntroduction to git & WordPress
Introduction to git & WordPress
 
Introducing Git to your FTP workflow
Introducing Git to your FTP workflow Introducing Git to your FTP workflow
Introducing Git to your FTP workflow
 
Every project is a story applying storytelling to your client interactions (1)
Every project is a story  applying storytelling to your client interactions (1)Every project is a story  applying storytelling to your client interactions (1)
Every project is a story applying storytelling to your client interactions (1)
 
RdF - Unitranche
RdF - UnitrancheRdF - Unitranche
RdF - Unitranche
 
Fictionalised biopics –
Fictionalised biopics –Fictionalised biopics –
Fictionalised biopics –
 
BADCamp 2012- Drupal Support
BADCamp 2012- Drupal SupportBADCamp 2012- Drupal Support
BADCamp 2012- Drupal Support
 
Ejercicio 9 carta
Ejercicio 9 cartaEjercicio 9 carta
Ejercicio 9 carta
 
Wp cli- intro and basics
Wp cli- intro and basicsWp cli- intro and basics
Wp cli- intro and basics
 

Semelhante a WordPress & Version Control: A Workflow

Developers, Be a Bada$$ with WP-CLI
Developers, Be a Bada$$ with WP-CLIDevelopers, Be a Bada$$ with WP-CLI
Developers, Be a Bada$$ with WP-CLIWP Engine
 
At Your Service: Using Jenkins in Operations
At Your Service: Using Jenkins in OperationsAt Your Service: Using Jenkins in Operations
At Your Service: Using Jenkins in OperationsMandi Walls
 
Тарас Кирилюк та Олена Пустовойт — CI workflow у веб-студії
Тарас Кирилюк та Олена Пустовойт — CI workflow у веб-студіїТарас Кирилюк та Олена Пустовойт — CI workflow у веб-студії
Тарас Кирилюк та Олена Пустовойт — CI workflow у веб-студіїLEDC 2016
 
CI workflow in a web studio
CI workflow in a web studioCI workflow in a web studio
CI workflow in a web studiodeWeb
 
WP-CLI: WordCamp NYC 2015
WP-CLI: WordCamp NYC 2015WP-CLI: WordCamp NYC 2015
WP-CLI: WordCamp NYC 2015Terell Moore
 
Deploying on the cutting edge
Deploying on the cutting edgeDeploying on the cutting edge
Deploying on the cutting edgeericholscher
 
JLPDevs - Optimization Tooling for Modern Web App Development
JLPDevs - Optimization Tooling for Modern Web App DevelopmentJLPDevs - Optimization Tooling for Modern Web App Development
JLPDevs - Optimization Tooling for Modern Web App DevelopmentJLP Community
 
Bundling Client Side Assets
Bundling Client Side AssetsBundling Client Side Assets
Bundling Client Side AssetsTimothy Oxley
 
Frontend Engineer Toolbox
Frontend Engineer ToolboxFrontend Engineer Toolbox
Frontend Engineer ToolboxYnon Perek
 
WordCamp Belfast DevOps for Beginners
WordCamp Belfast DevOps for BeginnersWordCamp Belfast DevOps for Beginners
WordCamp Belfast DevOps for BeginnersStewart Ritchie
 
XPages Blast - Lotusphere 2013
XPages Blast - Lotusphere 2013XPages Blast - Lotusphere 2013
XPages Blast - Lotusphere 2013Tim Clark
 
How to be a distribution-friendly project
How to be a distribution-friendly projectHow to be a distribution-friendly project
How to be a distribution-friendly projectDonnie Berkholz
 
Converting Your Dev Environment to a Docker Stack - php[world]
Converting Your Dev Environment to a Docker Stack - php[world]Converting Your Dev Environment to a Docker Stack - php[world]
Converting Your Dev Environment to a Docker Stack - php[world]Dana Luther
 
.Git for WordPress Developers
.Git for WordPress Developers.Git for WordPress Developers
.Git for WordPress Developersmpvanwinkle
 
Automated testing with Drupal
Automated testing with DrupalAutomated testing with Drupal
Automated testing with DrupalPromet Source
 
Increasing Reliability via Helm Pre-Release Checks (Helm Summit 2019)
Increasing Reliability via Helm Pre-Release Checks (Helm Summit 2019)Increasing Reliability via Helm Pre-Release Checks (Helm Summit 2019)
Increasing Reliability via Helm Pre-Release Checks (Helm Summit 2019)bridgetkromhout
 
Embulk, an open-source plugin-based parallel bulk data loader
Embulk, an open-source plugin-based parallel bulk data loaderEmbulk, an open-source plugin-based parallel bulk data loader
Embulk, an open-source plugin-based parallel bulk data loaderSadayuki Furuhashi
 
Zero Downtime Deployment with Ansible
Zero Downtime Deployment with AnsibleZero Downtime Deployment with Ansible
Zero Downtime Deployment with AnsibleStein Inge Morisbak
 

Semelhante a WordPress & Version Control: A Workflow (20)

Gulp - The Streaming Build System
Gulp - The Streaming Build SystemGulp - The Streaming Build System
Gulp - The Streaming Build System
 
Developers, Be a Bada$$ with WP-CLI
Developers, Be a Bada$$ with WP-CLIDevelopers, Be a Bada$$ with WP-CLI
Developers, Be a Bada$$ with WP-CLI
 
At Your Service: Using Jenkins in Operations
At Your Service: Using Jenkins in OperationsAt Your Service: Using Jenkins in Operations
At Your Service: Using Jenkins in Operations
 
Тарас Кирилюк та Олена Пустовойт — CI workflow у веб-студії
Тарас Кирилюк та Олена Пустовойт — CI workflow у веб-студіїТарас Кирилюк та Олена Пустовойт — CI workflow у веб-студії
Тарас Кирилюк та Олена Пустовойт — CI workflow у веб-студії
 
CI workflow in a web studio
CI workflow in a web studioCI workflow in a web studio
CI workflow in a web studio
 
WP-CLI: WordCamp NYC 2015
WP-CLI: WordCamp NYC 2015WP-CLI: WordCamp NYC 2015
WP-CLI: WordCamp NYC 2015
 
Deploying on the cutting edge
Deploying on the cutting edgeDeploying on the cutting edge
Deploying on the cutting edge
 
JLPDevs - Optimization Tooling for Modern Web App Development
JLPDevs - Optimization Tooling for Modern Web App DevelopmentJLPDevs - Optimization Tooling for Modern Web App Development
JLPDevs - Optimization Tooling for Modern Web App Development
 
Maven
MavenMaven
Maven
 
Bundling Client Side Assets
Bundling Client Side AssetsBundling Client Side Assets
Bundling Client Side Assets
 
Frontend Engineer Toolbox
Frontend Engineer ToolboxFrontend Engineer Toolbox
Frontend Engineer Toolbox
 
WordCamp Belfast DevOps for Beginners
WordCamp Belfast DevOps for BeginnersWordCamp Belfast DevOps for Beginners
WordCamp Belfast DevOps for Beginners
 
XPages Blast - Lotusphere 2013
XPages Blast - Lotusphere 2013XPages Blast - Lotusphere 2013
XPages Blast - Lotusphere 2013
 
How to be a distribution-friendly project
How to be a distribution-friendly projectHow to be a distribution-friendly project
How to be a distribution-friendly project
 
Converting Your Dev Environment to a Docker Stack - php[world]
Converting Your Dev Environment to a Docker Stack - php[world]Converting Your Dev Environment to a Docker Stack - php[world]
Converting Your Dev Environment to a Docker Stack - php[world]
 
.Git for WordPress Developers
.Git for WordPress Developers.Git for WordPress Developers
.Git for WordPress Developers
 
Automated testing with Drupal
Automated testing with DrupalAutomated testing with Drupal
Automated testing with Drupal
 
Increasing Reliability via Helm Pre-Release Checks (Helm Summit 2019)
Increasing Reliability via Helm Pre-Release Checks (Helm Summit 2019)Increasing Reliability via Helm Pre-Release Checks (Helm Summit 2019)
Increasing Reliability via Helm Pre-Release Checks (Helm Summit 2019)
 
Embulk, an open-source plugin-based parallel bulk data loader
Embulk, an open-source plugin-based parallel bulk data loaderEmbulk, an open-source plugin-based parallel bulk data loader
Embulk, an open-source plugin-based parallel bulk data loader
 
Zero Downtime Deployment with Ansible
Zero Downtime Deployment with AnsibleZero Downtime Deployment with Ansible
Zero Downtime Deployment with Ansible
 

Último

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 

Último (20)

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 

WordPress & Version Control: A Workflow

  • 1. WordPress  and   Version  Control A Workflow $ Aaron Holbrook A7 Web Design, Owner aaron@a7web.com Monday, June 11, 12
  • 2. aaron@a7web.com @aaronjholbrook a7web.com #wcmke #wpgit Monday, June 11, 12
  • 3. overview Background Disclaimer Assumptions Local Development Version Control (Git) Using WordPress & Git together Deployment Some demos Ask questions! #wcmke #wpgit Monday, June 11, 12
  • 4. have you ever... Wanted to make your changes live with the push of a button? Hated dragging files into FTP and wished for a better way? Been editing via FTP, made a change, closed the editor and immediately realized you shouldn’t have closed it? Lost code and didn’t have a backup? Had a backup, but it was too old? Had a site become corrupt, infected or lost with no way to recover it? #wcmke #wpgit Monday, June 11, 12
  • 5. a little history I had 10+ WordPress sites to maintain Sites were similar in layout and style differing only by color scheme Needed a way to quickly push out changes across all the sites Really wanted to utilize version control #wcmke #wpgit Monday, June 11, 12
  • 6. disclaimer! ma y vary) ileage YMMV (your m This workflow is something that I’ve refined to suit my needs, feel free to adjust it to suit yours #wcmke #wpgit Monday, June 11, 12
  • 7. assumptions You’re aware of how important Version Control is, but have not fully integrated it into your workflow You have some familiarity with the command line Your live server environment supports SSH (most hosts support SSH, sometimes you have to ask) You have a local development environment that you prefer to work within You’d like to have seamless, simple deployments #wcmke #wpgit Monday, June 11, 12
  • 8. the workflow Start local, develop some functionality Set up deployment system to your live server Deploy your changes with the press of a button! #wcmke #wpgit Monday, June 11, 12
  • 9. things you’ll need Terminal Git SSH #wcmke #wpgit Monday, June 11, 12
  • 10. legend Whenever you see $ command here Everything after the $ is what you should type #wcmke #wpgit Monday, June 11, 12
  • 11. “A civilized tool for a civilized age” - Si, stack overflow Monday, June 11, 12
  • 12. git 101 You can define a Git repository in any directory simply by typing: $ git init Via the terminal, navigate to the root of your local site directory and type $ git init #wcmke #wpgit Monday, June 11, 12
  • 13. .gitignore .DS_Store wp-config.local.php .htaccess Optional - ignore user uploads wp-content/uploads/ Optional - ignore live cache wp-content/cache/ #wcmke #wpgit Monday, June 11, 12
  • 14. git 102 In your git repo, add all files $ git add . Commit! $ git commit -m “Commit Message” Success! -m allows an i nline commit m essage #wcmke #wpgit Monday, June 11, 12
  • 16. this file is t wp-config.local.php he m agic key 1. Define local variables without contaminating the server 2. Add a call to wp-config.php to check for this file and load it if it exists Credit to Mark Jaquith who came up with this idea #wcmke #wpgit http://markjaquith.wordpress.com/2011/06/24/wordpress-local-dev-tips/ Monday, June 11, 12
  • 17. this file is t wp-config.local.php he m agic key #wcmke #wpgit Monday, June 11, 12
  • 18. wp-config.php 1. Test for wp-config.local.php 2. If it doesn’t exist, then use live server connection information #wcmke #wpgit Monday, June 11, 12
  • 19. wp-config.php #wcmke #wpgit Monday, June 11, 12
  • 20. ssh 101 1. $ ssh login@server.com 2. Enter password 3. success #wcmke #wpgit Monday, June 11, 12
  • 21. HUB & PRIME On the server, we will create two repositories HUB will be the main collaborator PRIME will be the live site repository Major props to Joe Maller #wcmke #wpgit http://joemaller.com/990/a-web-focused-git-workflow/ Monday, June 11, 12
  • 22. hub HUB Create hub as a bare repository I generally put it right above the site’s html root in a ‘git-hub’* folder /domains/site.com/html /domains/site.com/git-hub $ git init --bare * Not to be confused with the fantastic GitHub website #wcmke #wpgit https://github.com/ Monday, June 11, 12
  • 23. HUB hook We’ll want PRIME to auto-update when we push our changes up to H HUB So let’s set up a hook! #wcmke #wpgit Monday, June 11, 12
  • 24. HUB hook /git-hub/hooks/post-update #wcmke #wpgit Monday, June 11, 12
  • 25. PRIME 1. Create as regular repo $ git init 2. Add remote to HUB $ git remote add hub /domains/site.com/git-hub #wcmke #wpgit Monday, June 11, 12
  • 26. and finally Set up our local remote to HUB $ git remote add hub ssh://login@host.com/home/domains/site.com/git-hub Success! #wcmke #wpgit Monday, June 11, 12
  • 27. 3...2...1... blast off! Make sure that our repository is clean $ git add . $ git commit -am “Updated header to include nav links” ...wait for it... $ git push hub master We’ve deployed! hooray! #wcmke #wpgit Monday, June 11, 12
  • 28. push & pull Occasionally you will need to commit on the server and pull down to your local repository All you need to do (from local machine) $ git pull hub master #wcmke #wpgit Monday, June 11, 12
  • 29. caution! The uploads folder can change quite frequently, which may cause your repos to get out of sync, necessitating a need for frequent pulldowns to keep repos in check Depending on situation, you can ignore uploads/* directory or sync repos /uploads/* frequently #wcmke #wpgit Monday, June 11, 12
  • 30. take away Start local, develop some functionality Set up deployment system to your live server Deploy your changes with the press of a button! #wcmke #wpgit Monday, June 11, 12
  • 31. a7web.com @aaronjholbrook aaron@a7web.com #wcmke #wpgit Monday, June 11, 12