SlideShare ist ein Scribd-Unternehmen logo
1 von 33
Downloaden Sie, um offline zu lesen
git
and WordPress
Who am I?
● Owner & Director @ QC Creative
● PHP/MySQL Developer since 2004
● Front-end Specialist since 2007
● Amateur Photographer
● Lifelong Learner...
Why should you listen to me?
● Built custom PHP applications for clients
like Magic Hat & UVM
● Since 2010, have used WordPress for >90%
of projects
● Host & manage over 60 WordPress sites
How do we deploy now?
● “Cowboy Coding”
● FTP/SFTP/SCP with a local development
environment or staging server
● FTP/SFTP/SCP with local development AND
a staging server
Have you ever wondered...
● Did I edit that CSS file on my local copy or
on the FTP server?
● If I upload this, will it break anything?
● What if my client/boss wants me to undo all
of these changes?
We should be able to answer...
● Who changed this file?
● What did this file look like before?
● Where has this file been uploaded?
● When was this file changed?
● Why was this file changed?
Version Control to the Rescue!
Version control:
● tracks changes to files, as well as variations
or “branches” of an entire project
● allows us to move through a history of
snapshots of our project
● allows us to share our work with others
seamlessly
Some words...
Repository
Branch
Commit
Clone
Remote
Check out
Push
Pull
Fetch
git vs. SVN
In theory:
● SVN is centralized.
● git is decentralized.
In practice:
● git is often used with a centralized
repository.
Introduction to git & WordPress
SVN is centralized
● Complete project history is stored on a
central server.
● Individual developers “check out” the latest
versions of files in order to work on them.
● Branches are complete copies of the
project, stored in a separate folder.
git is distributed
● Every git repository contains a complete
history of the entire project.
● Any git repository can act as a “remote” for
any other git repository.
● Branches are cheap — they are just
pointers.
In practice, git is centralized too...
● git doesn’t care, but for the humans, it is usually best
to declare a canonical central repository.
● Usually you’ll use a hosted service like github or
bitbucket for this, but it is also possible to host
yourself.
● Teams may still share work amongst themselves before
“pushing” to the central repository.
Using git with subteams and a central repository
WordPress core development
● WordPress core development still uses SVN
:(
● It is possible to use git for core
development, and convert your patches to
SVN :)
git basics
● Working directory
● Staging area
● HEAD
The git workflow
Using Branches Best
● With git, branches are your friends.
● Branch early, branch often.
● Learn how interactively:http://pcottle.github.io/learnGitBranching/
For sole developers
● Designate a branch as your “clean” branch — usually
`master`.
● Create a new branch for each new feature or story.
● As a feature is completed and tested, merge its branch
into your clean branch, then deploy.
● Optionally maintain designated branches for each
server, to track what has been deployed.
● ONLY merge changes into server branches after you
have deployed the changes.
For teams
Read about git-flow
or github-flow.
Remote repositories
● Remote repositories can be anywhere.
● Usually, access is via SSH with private keys
for passwordless interactions.
● Sometimes the live site is a git repository.
We don’t want to track everything
● .gitignore is a plaintext file that tells git
which files and folders to ignore
● Create one for every repository
● Essential for using git with WordPress
● What to ignore:
o wp-content/uploads
o local config files
o self-contained external libraries
Using git with WordPress
● What do I track in git?
o My custom theme?
o My entire wp-content folder?
o My entire public folder?
o My entire project folder?
● Where do I keep my repositories?
My philosophy
Track everything.
Keep it anywhere.
2011: Mark Jaquith’s WP Skeleton
● Mark Jaquith is one of the lead WP Core
developers.
● Mark really doesn’t want you to cowboy
code.
● He made WP-Skeleton, which is a starter git
repository for WordPress project.
WP Skeleton
● WordPress core files are kept in a
subdirectory, tracked as a git submodule.
● wp-config.php is modified to allow local
configuration overrides.
● Everything is awesome…
● Right?
Not quite...
● git submodules are a major PITA.
● Submodules are not designed for
dependency management.
● Local config options could be more robust
and allow for multiple environments.
We need Dependency Management
● Wouldn’t it be great if we could keep one
list of all of the external plugins, themes,
and libraries required by our site, and have
it always kept up to date?
● Composer can do that for you.
Composer
● Installs, tracks and manages PHP libraries.
● WordPress is a PHP library
● WordPress plugins are PHP libraries
● WordPress themes are PHP libraries
● Most WordPress-directory plugins are
available for Composer through
wpackagist.org
Roots.io & Bedrock
● Bedrock is an open source WordPress
“starter pack.”
● It has everything you need to start using
composer and git with your WordPress
projects.
● Available at:
https://github.com/roots/bedrock
Thanks!
Thank you to Gregg Bense for organizing this
event
Thank you to the Fletcher Free Library for
hosting this event
Questions?
Josh Lee
(802) 735.2274
josh@qccreative.com
Additional Resources
BitBucket (http://bitbucket.org)
Github (http://github.org)
Source Tree (http://www.sourcetreeapp.com/)
Tower (http://www.git-tower.com/)
git-scm book (http://git-scm.com)
https://help.github.com/articles/generating-ssh-keys (The best info on SSH keys and how to use them with git)
http://rkulla.blogspot.com/2011/08/some-points-on-git-vs-subversion.html
http://www.slideshare.net/terrywang/git-101-tutorial-presentation (700-slide presentation — very
clear)http://pcottle.github.io/learnGitBranching/ (Interactive tutorial)
http://danielkummer.github.io/git-flow-cheatsheet/
http://nvie.com/posts/a-successful-git-branching-model/
http://documentup.com/skwp/git-workflows-book
http://wpengine.com/git/

Weitere ähnliche Inhalte

Was ist angesagt?

WordPress Developer tools
WordPress Developer toolsWordPress Developer tools
WordPress Developer toolsSudar Muthu
 
Angular2.0@Shanghai0319
Angular2.0@Shanghai0319Angular2.0@Shanghai0319
Angular2.0@Shanghai0319Bibby Chung
 
Integrating grunt and bower with maven
Integrating grunt and bower with mavenIntegrating grunt and bower with maven
Integrating grunt and bower with mavenRahul Nanwani
 
The Future of-the CMS (Twin Cities DrupalCamp 2015)
The Future of-the CMS (Twin Cities DrupalCamp 2015)The Future of-the CMS (Twin Cities DrupalCamp 2015)
The Future of-the CMS (Twin Cities DrupalCamp 2015)Todd Ross Nienkerk
 
Introduction to Gutenberg- Imran Sayed
Introduction to Gutenberg- Imran SayedIntroduction to Gutenberg- Imran Sayed
Introduction to Gutenberg- Imran SayedImran Sayed
 
Wade.Go Introduction Speech - SFD HCMC 2014
Wade.Go Introduction Speech - SFD HCMC 2014Wade.Go Introduction Speech - SFD HCMC 2014
Wade.Go Introduction Speech - SFD HCMC 2014Nguyễn Thành Hải
 
The Ultimate WordPress Development Environment
The Ultimate WordPress Development EnvironmentThe Ultimate WordPress Development Environment
The Ultimate WordPress Development EnvironmentMatt Geri
 
Ryan Markel - WordCamp StL 2016 - Code Review
Ryan Markel - WordCamp StL 2016 - Code ReviewRyan Markel - WordCamp StL 2016 - Code Review
Ryan Markel - WordCamp StL 2016 - Code Reviewryanmarkel
 
WordPress security & sanitation for beginners
WordPress security & sanitation for beginnersWordPress security & sanitation for beginners
WordPress security & sanitation for beginnersD'nelle Dowis
 
Front-end development automation with Grunt
Front-end development automation with GruntFront-end development automation with Grunt
Front-end development automation with Gruntbenko
 
Building the Front End with AngularJS
Building the Front End with AngularJSBuilding the Front End with AngularJS
Building the Front End with AngularJSJohn Ennew
 
Word press beirut December 4 Meetup - Gutenberg VS WP-Bakery
Word press beirut December 4 Meetup - Gutenberg VS WP-Bakery Word press beirut December 4 Meetup - Gutenberg VS WP-Bakery
Word press beirut December 4 Meetup - Gutenberg VS WP-Bakery Fadi Nicolas Zahhar
 
10 things you should know about django
10 things you should know about django10 things you should know about django
10 things you should know about djangoAdieu
 
The swiss knife of a word press developer
The swiss knife of a word press developerThe swiss knife of a word press developer
The swiss knife of a word press developerIvelina Dimova
 
WordCamp US 2016 - Ryan Markel: Code Review
WordCamp US 2016 - Ryan Markel: Code ReviewWordCamp US 2016 - Ryan Markel: Code Review
WordCamp US 2016 - Ryan Markel: Code Reviewthemarkel
 
Google web toolkit ( Gwt )
 Google web toolkit ( Gwt ) Google web toolkit ( Gwt )
Google web toolkit ( Gwt )Pankaj Bhasker
 

Was ist angesagt? (20)

WordPress Developer tools
WordPress Developer toolsWordPress Developer tools
WordPress Developer tools
 
Blogging for hackers (english)
Blogging for hackers (english)Blogging for hackers (english)
Blogging for hackers (english)
 
Blazor v1.1
Blazor v1.1Blazor v1.1
Blazor v1.1
 
Angular2.0@Shanghai0319
Angular2.0@Shanghai0319Angular2.0@Shanghai0319
Angular2.0@Shanghai0319
 
Integrating grunt and bower with maven
Integrating grunt and bower with mavenIntegrating grunt and bower with maven
Integrating grunt and bower with maven
 
The Future of-the CMS (Twin Cities DrupalCamp 2015)
The Future of-the CMS (Twin Cities DrupalCamp 2015)The Future of-the CMS (Twin Cities DrupalCamp 2015)
The Future of-the CMS (Twin Cities DrupalCamp 2015)
 
DevDay 2018 - Blazor
DevDay 2018 - BlazorDevDay 2018 - Blazor
DevDay 2018 - Blazor
 
Introduction to Gutenberg- Imran Sayed
Introduction to Gutenberg- Imran SayedIntroduction to Gutenberg- Imran Sayed
Introduction to Gutenberg- Imran Sayed
 
Wade.Go Introduction Speech - SFD HCMC 2014
Wade.Go Introduction Speech - SFD HCMC 2014Wade.Go Introduction Speech - SFD HCMC 2014
Wade.Go Introduction Speech - SFD HCMC 2014
 
The Ultimate WordPress Development Environment
The Ultimate WordPress Development EnvironmentThe Ultimate WordPress Development Environment
The Ultimate WordPress Development Environment
 
WP-Boot
WP-BootWP-Boot
WP-Boot
 
Ryan Markel - WordCamp StL 2016 - Code Review
Ryan Markel - WordCamp StL 2016 - Code ReviewRyan Markel - WordCamp StL 2016 - Code Review
Ryan Markel - WordCamp StL 2016 - Code Review
 
WordPress security & sanitation for beginners
WordPress security & sanitation for beginnersWordPress security & sanitation for beginners
WordPress security & sanitation for beginners
 
Front-end development automation with Grunt
Front-end development automation with GruntFront-end development automation with Grunt
Front-end development automation with Grunt
 
Building the Front End with AngularJS
Building the Front End with AngularJSBuilding the Front End with AngularJS
Building the Front End with AngularJS
 
Word press beirut December 4 Meetup - Gutenberg VS WP-Bakery
Word press beirut December 4 Meetup - Gutenberg VS WP-Bakery Word press beirut December 4 Meetup - Gutenberg VS WP-Bakery
Word press beirut December 4 Meetup - Gutenberg VS WP-Bakery
 
10 things you should know about django
10 things you should know about django10 things you should know about django
10 things you should know about django
 
The swiss knife of a word press developer
The swiss knife of a word press developerThe swiss knife of a word press developer
The swiss knife of a word press developer
 
WordCamp US 2016 - Ryan Markel: Code Review
WordCamp US 2016 - Ryan Markel: Code ReviewWordCamp US 2016 - Ryan Markel: Code Review
WordCamp US 2016 - Ryan Markel: Code Review
 
Google web toolkit ( Gwt )
 Google web toolkit ( Gwt ) Google web toolkit ( Gwt )
Google web toolkit ( Gwt )
 

Andere mochten auch

WordPress and Git
WordPress and GitWordPress and Git
WordPress and GitRob Miller
 
Developing with WordPress and Git
Developing with WordPress and GitDeveloping with WordPress and Git
Developing with WordPress and GitRob Miller
 
Wordpress version control
Wordpress version controlWordpress version control
Wordpress version controlDavid Doolin
 
WordPress Theme Development: Part 2
WordPress Theme Development: Part 2WordPress Theme Development: Part 2
WordPress Theme Development: Part 2Josh Lee
 
Introduction to using Grunt & Bower with WordPress theme development
Introduction to using Grunt & Bower with WordPress theme developmentIntroduction to using Grunt & Bower with WordPress theme development
Introduction to using Grunt & Bower with WordPress theme developmentJames Bundey
 
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
 
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
 
Writing Well-Behaved Unix Utilities
Writing Well-Behaved Unix UtilitiesWriting Well-Behaved Unix Utilities
Writing Well-Behaved Unix UtilitiesRob Miller
 
Using Git with WordPress - Presented by Nigel Rodgers.
Using Git with WordPress - Presented by Nigel Rodgers.Using Git with WordPress - Presented by Nigel Rodgers.
Using Git with WordPress - Presented by Nigel Rodgers.WordCamp Harare
 
WordPress & Version Control: A Workflow
WordPress & Version Control: A WorkflowWordPress & Version Control: A Workflow
WordPress & Version Control: A WorkflowAaron Holbrook
 
WordPress Theme Structure
WordPress Theme StructureWordPress Theme Structure
WordPress Theme Structurekeithdevon
 

Andere mochten auch (12)

WordPress and Git
WordPress and GitWordPress and Git
WordPress and Git
 
Developing with WordPress and Git
Developing with WordPress and GitDeveloping with WordPress and Git
Developing with WordPress and Git
 
Wordpress version control
Wordpress version controlWordpress version control
Wordpress version control
 
WordPress Development - Taxonomies
WordPress Development -  TaxonomiesWordPress Development -  Taxonomies
WordPress Development - Taxonomies
 
WordPress Theme Development: Part 2
WordPress Theme Development: Part 2WordPress Theme Development: Part 2
WordPress Theme Development: Part 2
 
Introduction to using Grunt & Bower with WordPress theme development
Introduction to using Grunt & Bower with WordPress theme developmentIntroduction to using Grunt & Bower with WordPress theme development
Introduction to using Grunt & Bower with WordPress theme development
 
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!)
 
Introducing Git to your FTP workflow
Introducing Git to your FTP workflow Introducing Git to your FTP workflow
Introducing Git to your FTP workflow
 
Writing Well-Behaved Unix Utilities
Writing Well-Behaved Unix UtilitiesWriting Well-Behaved Unix Utilities
Writing Well-Behaved Unix Utilities
 
Using Git with WordPress - Presented by Nigel Rodgers.
Using Git with WordPress - Presented by Nigel Rodgers.Using Git with WordPress - Presented by Nigel Rodgers.
Using Git with WordPress - Presented by Nigel Rodgers.
 
WordPress & Version Control: A Workflow
WordPress & Version Control: A WorkflowWordPress & Version Control: A Workflow
WordPress & Version Control: A Workflow
 
WordPress Theme Structure
WordPress Theme StructureWordPress Theme Structure
WordPress Theme Structure
 

Ähnlich wie Introduction to git & WordPress

Open Innovation Lab (OIL) - 20150227 - GIT Intro Workshop
Open Innovation Lab (OIL) - 20150227 - GIT Intro WorkshopOpen Innovation Lab (OIL) - 20150227 - GIT Intro Workshop
Open Innovation Lab (OIL) - 20150227 - GIT Intro WorkshopWong Hoi Sing Edison
 
How to plan and define your CI-CD pipeline
How to plan and define your CI-CD pipelineHow to plan and define your CI-CD pipeline
How to plan and define your CI-CD pipelineElasTest Project
 
Barcamp Macau 2014 - Introduction to GIT
Barcamp Macau 2014 - Introduction to GITBarcamp Macau 2014 - Introduction to GIT
Barcamp Macau 2014 - Introduction to GITWong Hoi Sing Edison
 
My "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails ProjectsMy "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails ProjectsGR8Conf
 
Collaborative development with git
Collaborative development with gitCollaborative development with git
Collaborative development with gitJoseluis Laso
 
Puppet managed loadays
Puppet managed loadaysPuppet managed loadays
Puppet managed loadaysloadays
 
Efficient development workflows with composer
Efficient development workflows with composerEfficient development workflows with composer
Efficient development workflows with composernuppla
 
Puppet managed loadays
Puppet managed loadaysPuppet managed loadays
Puppet managed loadaysYankee Nemoy
 
Plone Intranet under the hood
Plone Intranet under the hoodPlone Intranet under the hood
Plone Intranet under the hoodGuido Stevens
 
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Michael Lihs
 
Efficient development workflows with composer
Efficient development workflows with composerEfficient development workflows with composer
Efficient development workflows with composernuppla
 
Que nos espera a los ALM Dudes para el 2013?
Que nos espera a los ALM Dudes para el 2013?Que nos espera a los ALM Dudes para el 2013?
Que nos espera a los ALM Dudes para el 2013?Bruno Capuano
 
Git 101: Force-sensitive to Jedi padawan
Git 101: Force-sensitive to Jedi padawanGit 101: Force-sensitive to Jedi padawan
Git 101: Force-sensitive to Jedi padawanJames Ford
 
[HKDUG] #20180512 - Fix Hacked Drupal with GIT
[HKDUG] #20180512 - Fix Hacked Drupal with GIT[HKDUG] #20180512 - Fix Hacked Drupal with GIT
[HKDUG] #20180512 - Fix Hacked Drupal with GITWong Hoi Sing Edison
 
Go with the Flow - A Guide to a WordPress Workflow
Go with the Flow - A Guide to a WordPress WorkflowGo with the Flow - A Guide to a WordPress Workflow
Go with the Flow - A Guide to a WordPress WorkflowAnn Cascarano
 

Ähnlich wie Introduction to git & WordPress (20)

Git sourcecontrolpreso
Git sourcecontrolpresoGit sourcecontrolpreso
Git sourcecontrolpreso
 
Open Innovation Lab (OIL) - 20150227 - GIT Intro Workshop
Open Innovation Lab (OIL) - 20150227 - GIT Intro WorkshopOpen Innovation Lab (OIL) - 20150227 - GIT Intro Workshop
Open Innovation Lab (OIL) - 20150227 - GIT Intro Workshop
 
How to plan and define your CI-CD pipeline
How to plan and define your CI-CD pipelineHow to plan and define your CI-CD pipeline
How to plan and define your CI-CD pipeline
 
Barcamp Macau 2014 - Introduction to GIT
Barcamp Macau 2014 - Introduction to GITBarcamp Macau 2014 - Introduction to GIT
Barcamp Macau 2014 - Introduction to GIT
 
My "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails ProjectsMy "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails Projects
 
Collaborative development with git
Collaborative development with gitCollaborative development with git
Collaborative development with git
 
Puppet managed loadays
Puppet managed loadaysPuppet managed loadays
Puppet managed loadays
 
Efficient development workflows with composer
Efficient development workflows with composerEfficient development workflows with composer
Efficient development workflows with composer
 
Puppet managed loadays
Puppet managed loadaysPuppet managed loadays
Puppet managed loadays
 
Plone Intranet under the hood
Plone Intranet under the hoodPlone Intranet under the hood
Plone Intranet under the hood
 
01 - Git vs SVN
01 - Git vs SVN01 - Git vs SVN
01 - Git vs SVN
 
Git pusshuten
Git pusshutenGit pusshuten
Git pusshuten
 
Git best practices workshop
Git best practices workshopGit best practices workshop
Git best practices workshop
 
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
 
Efficient development workflows with composer
Efficient development workflows with composerEfficient development workflows with composer
Efficient development workflows with composer
 
Que nos espera a los ALM Dudes para el 2013?
Que nos espera a los ALM Dudes para el 2013?Que nos espera a los ALM Dudes para el 2013?
Que nos espera a los ALM Dudes para el 2013?
 
Git In One Evening
Git In One EveningGit In One Evening
Git In One Evening
 
Git 101: Force-sensitive to Jedi padawan
Git 101: Force-sensitive to Jedi padawanGit 101: Force-sensitive to Jedi padawan
Git 101: Force-sensitive to Jedi padawan
 
[HKDUG] #20180512 - Fix Hacked Drupal with GIT
[HKDUG] #20180512 - Fix Hacked Drupal with GIT[HKDUG] #20180512 - Fix Hacked Drupal with GIT
[HKDUG] #20180512 - Fix Hacked Drupal with GIT
 
Go with the Flow - A Guide to a WordPress Workflow
Go with the Flow - A Guide to a WordPress WorkflowGo with the Flow - A Guide to a WordPress Workflow
Go with the Flow - A Guide to a WordPress Workflow
 

Kürzlich hochgeladen

Niche Domination Prodigy Review Plus Bonus
Niche Domination Prodigy Review Plus BonusNiche Domination Prodigy Review Plus Bonus
Niche Domination Prodigy Review Plus BonusSkylark Nobin
 
Benefits of doing Internet peering and running an Internet Exchange (IX) pres...
Benefits of doing Internet peering and running an Internet Exchange (IX) pres...Benefits of doing Internet peering and running an Internet Exchange (IX) pres...
Benefits of doing Internet peering and running an Internet Exchange (IX) pres...APNIC
 
Check out the Free Landing Page Hosting in 2024
Check out the Free Landing Page Hosting in 2024Check out the Free Landing Page Hosting in 2024
Check out the Free Landing Page Hosting in 2024Shubham Pant
 
Zero-day Vulnerabilities
Zero-day VulnerabilitiesZero-day Vulnerabilities
Zero-day Vulnerabilitiesalihassaah1994
 
LESSON 10/ GROUP 10/ ST. THOMAS AQUINASS
LESSON 10/ GROUP 10/ ST. THOMAS AQUINASSLESSON 10/ GROUP 10/ ST. THOMAS AQUINASS
LESSON 10/ GROUP 10/ ST. THOMAS AQUINASSlesteraporado16
 
Bio Medical Waste Management Guideliness 2023 ppt.pptx
Bio Medical Waste Management Guideliness 2023 ppt.pptxBio Medical Waste Management Guideliness 2023 ppt.pptx
Bio Medical Waste Management Guideliness 2023 ppt.pptxnaveenithkrishnan
 
TYPES AND DEFINITION OF ONLINE CRIMES AND HAZARDS
TYPES AND DEFINITION OF ONLINE CRIMES AND HAZARDSTYPES AND DEFINITION OF ONLINE CRIMES AND HAZARDS
TYPES AND DEFINITION OF ONLINE CRIMES AND HAZARDSedrianrheine
 
A_Z-1_0_4T_00A-EN_U-Po_w_erPoint_06.pptx
A_Z-1_0_4T_00A-EN_U-Po_w_erPoint_06.pptxA_Z-1_0_4T_00A-EN_U-Po_w_erPoint_06.pptx
A_Z-1_0_4T_00A-EN_U-Po_w_erPoint_06.pptxjayshuklatrainer
 
WordPress by the numbers - Jan Loeffler, CTO WebPros, CloudFest 2024
WordPress by the numbers - Jan Loeffler, CTO WebPros, CloudFest 2024WordPress by the numbers - Jan Loeffler, CTO WebPros, CloudFest 2024
WordPress by the numbers - Jan Loeffler, CTO WebPros, CloudFest 2024Jan Löffler
 
Computer 10 Lesson 8: Building a Website
Computer 10 Lesson 8: Building a WebsiteComputer 10 Lesson 8: Building a Website
Computer 10 Lesson 8: Building a WebsiteMavein
 
Introduction to ICANN and Fellowship program by Shreedeep Rayamajhi.pdf
Introduction to ICANN and Fellowship program  by Shreedeep Rayamajhi.pdfIntroduction to ICANN and Fellowship program  by Shreedeep Rayamajhi.pdf
Introduction to ICANN and Fellowship program by Shreedeep Rayamajhi.pdfShreedeep Rayamajhi
 
Vision Forward: Tracing Image Search SEO From Its Roots To AI-Enhanced Horizons
Vision Forward: Tracing Image Search SEO From Its Roots To AI-Enhanced HorizonsVision Forward: Tracing Image Search SEO From Its Roots To AI-Enhanced Horizons
Vision Forward: Tracing Image Search SEO From Its Roots To AI-Enhanced HorizonsRoxana Stingu
 
LESSON 5 GROUP 10 ST. THOMAS AQUINAS.pdf
LESSON 5 GROUP 10 ST. THOMAS AQUINAS.pdfLESSON 5 GROUP 10 ST. THOMAS AQUINAS.pdf
LESSON 5 GROUP 10 ST. THOMAS AQUINAS.pdfmchristianalwyn
 
world Tuberculosis day ppt 25-3-2024.pptx
world Tuberculosis day ppt 25-3-2024.pptxworld Tuberculosis day ppt 25-3-2024.pptx
world Tuberculosis day ppt 25-3-2024.pptxnaveenithkrishnan
 
Presentation2.pptx - JoyPress Wordpress
Presentation2.pptx -  JoyPress WordpressPresentation2.pptx -  JoyPress Wordpress
Presentation2.pptx - JoyPress Wordpressssuser166378
 

Kürzlich hochgeladen (15)

Niche Domination Prodigy Review Plus Bonus
Niche Domination Prodigy Review Plus BonusNiche Domination Prodigy Review Plus Bonus
Niche Domination Prodigy Review Plus Bonus
 
Benefits of doing Internet peering and running an Internet Exchange (IX) pres...
Benefits of doing Internet peering and running an Internet Exchange (IX) pres...Benefits of doing Internet peering and running an Internet Exchange (IX) pres...
Benefits of doing Internet peering and running an Internet Exchange (IX) pres...
 
Check out the Free Landing Page Hosting in 2024
Check out the Free Landing Page Hosting in 2024Check out the Free Landing Page Hosting in 2024
Check out the Free Landing Page Hosting in 2024
 
Zero-day Vulnerabilities
Zero-day VulnerabilitiesZero-day Vulnerabilities
Zero-day Vulnerabilities
 
LESSON 10/ GROUP 10/ ST. THOMAS AQUINASS
LESSON 10/ GROUP 10/ ST. THOMAS AQUINASSLESSON 10/ GROUP 10/ ST. THOMAS AQUINASS
LESSON 10/ GROUP 10/ ST. THOMAS AQUINASS
 
Bio Medical Waste Management Guideliness 2023 ppt.pptx
Bio Medical Waste Management Guideliness 2023 ppt.pptxBio Medical Waste Management Guideliness 2023 ppt.pptx
Bio Medical Waste Management Guideliness 2023 ppt.pptx
 
TYPES AND DEFINITION OF ONLINE CRIMES AND HAZARDS
TYPES AND DEFINITION OF ONLINE CRIMES AND HAZARDSTYPES AND DEFINITION OF ONLINE CRIMES AND HAZARDS
TYPES AND DEFINITION OF ONLINE CRIMES AND HAZARDS
 
A_Z-1_0_4T_00A-EN_U-Po_w_erPoint_06.pptx
A_Z-1_0_4T_00A-EN_U-Po_w_erPoint_06.pptxA_Z-1_0_4T_00A-EN_U-Po_w_erPoint_06.pptx
A_Z-1_0_4T_00A-EN_U-Po_w_erPoint_06.pptx
 
WordPress by the numbers - Jan Loeffler, CTO WebPros, CloudFest 2024
WordPress by the numbers - Jan Loeffler, CTO WebPros, CloudFest 2024WordPress by the numbers - Jan Loeffler, CTO WebPros, CloudFest 2024
WordPress by the numbers - Jan Loeffler, CTO WebPros, CloudFest 2024
 
Computer 10 Lesson 8: Building a Website
Computer 10 Lesson 8: Building a WebsiteComputer 10 Lesson 8: Building a Website
Computer 10 Lesson 8: Building a Website
 
Introduction to ICANN and Fellowship program by Shreedeep Rayamajhi.pdf
Introduction to ICANN and Fellowship program  by Shreedeep Rayamajhi.pdfIntroduction to ICANN and Fellowship program  by Shreedeep Rayamajhi.pdf
Introduction to ICANN and Fellowship program by Shreedeep Rayamajhi.pdf
 
Vision Forward: Tracing Image Search SEO From Its Roots To AI-Enhanced Horizons
Vision Forward: Tracing Image Search SEO From Its Roots To AI-Enhanced HorizonsVision Forward: Tracing Image Search SEO From Its Roots To AI-Enhanced Horizons
Vision Forward: Tracing Image Search SEO From Its Roots To AI-Enhanced Horizons
 
LESSON 5 GROUP 10 ST. THOMAS AQUINAS.pdf
LESSON 5 GROUP 10 ST. THOMAS AQUINAS.pdfLESSON 5 GROUP 10 ST. THOMAS AQUINAS.pdf
LESSON 5 GROUP 10 ST. THOMAS AQUINAS.pdf
 
world Tuberculosis day ppt 25-3-2024.pptx
world Tuberculosis day ppt 25-3-2024.pptxworld Tuberculosis day ppt 25-3-2024.pptx
world Tuberculosis day ppt 25-3-2024.pptx
 
Presentation2.pptx - JoyPress Wordpress
Presentation2.pptx -  JoyPress WordpressPresentation2.pptx -  JoyPress Wordpress
Presentation2.pptx - JoyPress Wordpress
 

Introduction to git & WordPress

  • 2. Who am I? ● Owner & Director @ QC Creative ● PHP/MySQL Developer since 2004 ● Front-end Specialist since 2007 ● Amateur Photographer ● Lifelong Learner...
  • 3. Why should you listen to me? ● Built custom PHP applications for clients like Magic Hat & UVM ● Since 2010, have used WordPress for >90% of projects ● Host & manage over 60 WordPress sites
  • 4. How do we deploy now? ● “Cowboy Coding” ● FTP/SFTP/SCP with a local development environment or staging server ● FTP/SFTP/SCP with local development AND a staging server
  • 5. Have you ever wondered... ● Did I edit that CSS file on my local copy or on the FTP server? ● If I upload this, will it break anything? ● What if my client/boss wants me to undo all of these changes?
  • 6. We should be able to answer... ● Who changed this file? ● What did this file look like before? ● Where has this file been uploaded? ● When was this file changed? ● Why was this file changed?
  • 7. Version Control to the Rescue! Version control: ● tracks changes to files, as well as variations or “branches” of an entire project ● allows us to move through a history of snapshots of our project ● allows us to share our work with others seamlessly
  • 9. git vs. SVN In theory: ● SVN is centralized. ● git is decentralized. In practice: ● git is often used with a centralized repository.
  • 11. SVN is centralized ● Complete project history is stored on a central server. ● Individual developers “check out” the latest versions of files in order to work on them. ● Branches are complete copies of the project, stored in a separate folder.
  • 12. git is distributed ● Every git repository contains a complete history of the entire project. ● Any git repository can act as a “remote” for any other git repository. ● Branches are cheap — they are just pointers.
  • 13. In practice, git is centralized too... ● git doesn’t care, but for the humans, it is usually best to declare a canonical central repository. ● Usually you’ll use a hosted service like github or bitbucket for this, but it is also possible to host yourself. ● Teams may still share work amongst themselves before “pushing” to the central repository.
  • 14. Using git with subteams and a central repository
  • 15. WordPress core development ● WordPress core development still uses SVN :( ● It is possible to use git for core development, and convert your patches to SVN :)
  • 16. git basics ● Working directory ● Staging area ● HEAD
  • 18. Using Branches Best ● With git, branches are your friends. ● Branch early, branch often. ● Learn how interactively:http://pcottle.github.io/learnGitBranching/
  • 19. For sole developers ● Designate a branch as your “clean” branch — usually `master`. ● Create a new branch for each new feature or story. ● As a feature is completed and tested, merge its branch into your clean branch, then deploy. ● Optionally maintain designated branches for each server, to track what has been deployed. ● ONLY merge changes into server branches after you have deployed the changes.
  • 20. For teams Read about git-flow or github-flow.
  • 21. Remote repositories ● Remote repositories can be anywhere. ● Usually, access is via SSH with private keys for passwordless interactions. ● Sometimes the live site is a git repository.
  • 22. We don’t want to track everything ● .gitignore is a plaintext file that tells git which files and folders to ignore ● Create one for every repository ● Essential for using git with WordPress ● What to ignore: o wp-content/uploads o local config files o self-contained external libraries
  • 23. Using git with WordPress ● What do I track in git? o My custom theme? o My entire wp-content folder? o My entire public folder? o My entire project folder? ● Where do I keep my repositories?
  • 25. 2011: Mark Jaquith’s WP Skeleton ● Mark Jaquith is one of the lead WP Core developers. ● Mark really doesn’t want you to cowboy code. ● He made WP-Skeleton, which is a starter git repository for WordPress project.
  • 26. WP Skeleton ● WordPress core files are kept in a subdirectory, tracked as a git submodule. ● wp-config.php is modified to allow local configuration overrides. ● Everything is awesome… ● Right?
  • 27. Not quite... ● git submodules are a major PITA. ● Submodules are not designed for dependency management. ● Local config options could be more robust and allow for multiple environments.
  • 28. We need Dependency Management ● Wouldn’t it be great if we could keep one list of all of the external plugins, themes, and libraries required by our site, and have it always kept up to date? ● Composer can do that for you.
  • 29. Composer ● Installs, tracks and manages PHP libraries. ● WordPress is a PHP library ● WordPress plugins are PHP libraries ● WordPress themes are PHP libraries ● Most WordPress-directory plugins are available for Composer through wpackagist.org
  • 30. Roots.io & Bedrock ● Bedrock is an open source WordPress “starter pack.” ● It has everything you need to start using composer and git with your WordPress projects. ● Available at: https://github.com/roots/bedrock
  • 31. Thanks! Thank you to Gregg Bense for organizing this event Thank you to the Fletcher Free Library for hosting this event
  • 33. Additional Resources BitBucket (http://bitbucket.org) Github (http://github.org) Source Tree (http://www.sourcetreeapp.com/) Tower (http://www.git-tower.com/) git-scm book (http://git-scm.com) https://help.github.com/articles/generating-ssh-keys (The best info on SSH keys and how to use them with git) http://rkulla.blogspot.com/2011/08/some-points-on-git-vs-subversion.html http://www.slideshare.net/terrywang/git-101-tutorial-presentation (700-slide presentation — very clear)http://pcottle.github.io/learnGitBranching/ (Interactive tutorial) http://danielkummer.github.io/git-flow-cheatsheet/ http://nvie.com/posts/a-successful-git-branching-model/ http://documentup.com/skwp/git-workflows-book http://wpengine.com/git/

Hinweis der Redaktion

  1. Tutorial Create a repository. Change a file. Add changes. Commit changes. View log. Repeat w/ Source Tree