SlideShare ist ein Scribd-Unternehmen logo
1 von 117
Downloaden Sie, um offline zu lesen
Developing with
                         WordPress and Git
                             Rob Miller • @robmil
                               Big Fish Design




Friday, 23 November 12                              1
An introduction



Friday, 23 November 12                     2
“Git”? Huh?
                         What’s that?




Friday, 23 November 12                  3
“Git”? Huh?
                           What’s that?

                    • A distributed version control system




Friday, 23 November 12                                       3
“Git”? Huh?
                           What’s that?

                    • A distributed version control system
                    • Free



Friday, 23 November 12                                       3
“Git”? Huh?
                           What’s that?

                    • A distributed version control system
                    • Free
                    • Open source


Friday, 23 November 12                                       3
“Git”? Huh?
                           What’s that?

                    • A distributed version control system
                    • Free
                    • Open source
                    • Popular

Friday, 23 November 12                                       3
A crash course in
                          version control


Friday, 23 November 12                       4
What is
                         version control?




Friday, 23 November 12                      5
What is
                         version control?
                    • Track changes made to source code




Friday, 23 November 12                                    5
What is
                         version control?
                    • Track changes made to source code
                    • Who did what and when




Friday, 23 November 12                                    5
What is
                          version control?
                    • Track changes made to source code
                    • Who did what and when
                    • When things break, revert to the point
                         when it last worked




Friday, 23 November 12                                         5
What is
                          version control?
                    • Track changes made to source code
                    • Who did what and when
                    • When things break, revert to the point
                         when it last worked

                    • Like Time Machine for your website’s
                         code (but not database/content…)


Friday, 23 November 12                                         5
Why version control?




Friday, 23 November 12                  6
Why version control?
                    • “I just deleted a file by mistake — can we get
                         it back?”




Friday, 23 November 12                                                 6
Why version control?
                    • “I just deleted a file by mistake — can we get
                         it back?”

                    • “I need to know who made this change —
                         can we find out?”




Friday, 23 November 12                                                 6
Why version control?
                    • “I just deleted a file by mistake — can we get
                         it back?”

                    • “I need to know who made this change —
                         can we find out?”

                    • “That feature just broke the site — can we
                         revert it?”




Friday, 23 November 12                                                 6
Why version control?
                    • “I just deleted a file by mistake — can we get
                         it back?”

                    • “I need to know who made this change —
                         can we find out?”

                    • “That feature just broke the site — can we
                         revert it?”

                    • “There’s a bug that didn’t use to exist. When
                         was it introduced?”


Friday, 23 November 12                                                 6
Centralised
                         vs. distributed


Friday, 23 November 12                     7
Centralised
                         version control




Friday, 23 November 12                     8
Centralised
                           version control
                    • History stored in a central repository
                         running on a server




Friday, 23 November 12                                         8
Centralised
                           version control
                    • History stored in a central repository
                         running on a server

                    • Everyone commits to and from this
                         repository




Friday, 23 November 12                                         8
Centralised
                           version control
                    • History stored in a central repository
                         running on a server

                    • Everyone commits to and from this
                         repository

                    • Examples: CVS, Subversion (SVN),
                         Perforce, ClearCase



Friday, 23 November 12                                         8
Distributed
                         version control




Friday, 23 November 12                     9
Distributed
                         version control
                    • No central server




Friday, 23 November 12                     9
Distributed
                            version control
                    • No central server
                    • Every team member has a copy of the
                         entire repository and its history




Friday, 23 November 12                                       9
Distributed
                            version control
                    • No central server
                    • Every team member has a copy of the
                         entire repository and its history

                    • Git isn’t the only option — e.g.
                         Mercurial



Friday, 23 November 12                                       9
Advantages of DVCS




Friday, 23 November 12                10
Advantages of DVCS

                    • Redundancy




Friday, 23 November 12                10
Advantages of DVCS

                    • Redundancy
                    • Offline working



Friday, 23 November 12                  10
Advantages of DVCS

                    • Redundancy
                    • Offline working
                    • Speed


Friday, 23 November 12                  10
Git



Friday, 23 November 12         11
Git ≠ GitHub



Friday, 23 November 12                  12
Terminology, part one




Friday, 23 November 12                           13
Terminology, part one

                    • Commit




Friday, 23 November 12                           13
Terminology, part one

                    • Commit
                    • Branch



Friday, 23 November 12                           13
Terminology, part one

                    • Commit
                    • Branch
                    • Tag


Friday, 23 November 12                           13
Terminology, part one

                    • Commit
                    • Branch
                    • Tag
                    • Diff

Friday, 23 November 12                           13
Terminology, part one

                    • Commit
                    • Branch
                    • Tag
                    • Diff
                    • Commitish
Friday, 23 November 12                           13
Terminology, part two




Friday, 23 November 12                           14
Terminology, part two


                    • Pulling




Friday, 23 November 12                           14
Terminology, part two


                    • Pulling
                    • Pushing



Friday, 23 November 12                           14
Terminology, part two


                    • Pulling
                    • Pushing
                    • Cloning


Friday, 23 November 12                           14
What’s in a Git commit?




Friday, 23 November 12                             15
What’s in a Git commit?




Friday, 23 November 12                             15
What’s in a Git commit?




Friday, 23 November 12                             15
What’s in a Git commit?




Friday, 23 November 12                             15
What’s in a Git commit?




Friday, 23 November 12                             15
Branches




Friday, 23 November 12              16
Branches
                    • In Subversion, they’re basically useless




Friday, 23 November 12                                           16
Branches
                    • In Subversion, they’re basically useless
                    • In Git, they’re at the heart of almost
                         everything




Friday, 23 November 12                                           16
Branches
                    • In Subversion, they’re basically useless
                    • In Git, they’re at the heart of almost
                         everything

                    • Juggle as many different versions of your
                         code as you like




Friday, 23 November 12                                            16
Branches
                    • In Subversion, they’re basically useless
                    • In Git, they’re at the heart of almost
                         everything

                    • Juggle as many different versions of your
                         code as you like

                    • Keep all your features nice and separate


Friday, 23 November 12                                            16
Branches
                    • In Subversion, they’re basically useless
                    • In Git, they’re at the heart of almost
                         everything

                    • Juggle as many different versions of your
                         code as you like

                    • Keep all your features nice and separate
                    • Merge painlessly once you’re done

Friday, 23 November 12                                            16
Special branch




Friday, 23 November 12                    17
Special branch

                    • Git doesn’t force you to have any
                         particular branches




Friday, 23 November 12                                    17
Special branch

                    • Git doesn’t force you to have any
                         particular branches

                    • But by convention, master is your
                         stable branch




Friday, 23 November 12                                    17
Special branch

                    • Git doesn’t force you to have any
                         particular branches

                    • But by convention, master is your
                         stable branch

                    • Branch from it; merge to it; your
                         releases are taken from it



Friday, 23 November 12                                    17
Branch commands




Friday, 23 November 12                     18
Branch commands
                    • git branch foo will create a branch
                         called “foo”.




Friday, 23 November 12                                      18
Branch commands
                    • git branch foo will create a branch
                         called “foo”.

                    • git checkout bar will switch to the
                         branch called “bar”




Friday, 23 November 12                                      18
Branch commands
                    • git branch foo will create a branch
                         called “foo”.

                    • git checkout bar will switch to the
                         branch called “bar”

                    • git branch -d foo will delete a branch
                         if you change your mind about it


Friday, 23 November 12                                         18
Merging




Friday, 23 November 12             19
Merging

                    • Once you’re done with a branch, you
                         can merge it into another:
                         $ git checkout master
                         $ git merge --no-ff foo




Friday, 23 November 12                                      19
When should
                         you branch?




Friday, 23 November 12                 20
When should
                           you branch?

                    • For individual features




Friday, 23 November 12                          20
When should
                          you branch?

                    • For individual features
                    • What does that mean, though?



Friday, 23 November 12                               20
When should
                             you branch?

                    • For individual features
                    • What does that mean, though?
                    • Generally: anything that might be put
                         live independently




Friday, 23 November 12                                        20
Setting up
                         a repository


Friday, 23 November 12                  21
Friday, 23 November 12   22
$ git init




Friday, 23 November 12                22
Working
                         with a team


Friday, 23 November 12                 23
A typical team setup




Friday, 23 November 12                   24
A typical team setup

                         You




Friday, 23 November 12                   24
A typical team setup

                         You




          The rest of the team




Friday, 23 November 12                   24
A typical team setup
                                 Hub

                         You




          The rest of the team




Friday, 23 November 12                   24
A typical team setup
                                 Hub

                         You


                                       Staging
          The rest of the team




Friday, 23 November 12                           24
A typical team setup
                                 Hub

                         You           Production


                                        Staging
          The rest of the team




Friday, 23 November 12                              24
Hooks



Friday, 23 November 12           25
Friday, 23 November 12   26
• Scripts that run after certain events
                         — just like actions in WordPress




Friday, 23 November 12                                        26
• Scripts that run after certain events
                         — just like actions in WordPress

                    • Potential uses:




Friday, 23 November 12                                        26
• Scripts that run after certain events
                         — just like actions in WordPress

                    • Potential uses:
                     • Post a message in an IRC channel
                          when someone pushes




Friday, 23 November 12                                        26
• Scripts that run after certain events
                         — just like actions in WordPress

                    • Potential uses:
                     • Post a message in an IRC channel
                           when someone pushes
                         • Deploy to the live site when
                           someone pushes on master




Friday, 23 November 12                                        26
• Scripts that run after certain events
                         — just like actions in WordPress

                    • Potential uses:
                     • Post a message in an IRC channel
                           when someone pushes
                         • Deploy to the live site when
                           someone pushes on master
                         • Run a syntax checker/strip
                           whitespace/etc. before commits


Friday, 23 November 12                                        26
Git and WordPress



Friday, 23 November 12                       27
Things to exclude




Friday, 23 November 12                       28
Things to exclude

                    • wp-config.php




Friday, 23 November 12                       28
Things to exclude

                    • wp-config.php
                    • wp-uploads/* (or perhaps not…)



Friday, 23 November 12                                 28
Things to exclude

                    • wp-config.php
                    • wp-uploads/* (or perhaps not…)
                    • Anything that might conceivably be
                         different on live vs. development




Friday, 23 November 12                                       28
Image uploads




Friday, 23 November 12                   29
Image uploads

                    • Image uploads inevitably happen on
                         live




Friday, 23 November 12                                     29
Image uploads

                    • Image uploads inevitably happen on
                         live

                    • Are they content (so should be
                         excluded from Git)?




Friday, 23 November 12                                     29
Image uploads

                    • Image uploads inevitably happen on
                         live

                    • Are they content (so should be
                         excluded from Git)?

                    • Or are they layout/template related
                         (so should be included in Git)?



Friday, 23 November 12                                      29
Potential solutions




Friday, 23 November 12                         30
Potential solutions
                    • Ignore them — don’t have them in Git at all




Friday, 23 November 12                                              30
Potential solutions
                    • Ignore them — don’t have them in Git at all
                    • Periodically add them into Git from the live
                         server




Friday, 23 November 12                                               30
Potential solutions
                    • Ignore them — don’t have them in Git at all
                    • Periodically add them into Git from the live
                         server

                    • Automate the adding of them e.g. with a
                         WordPress hook




Friday, 23 November 12                                               30
Potential solutions
                    • Ignore them — don’t have them in Git at all
                    • Periodically add them into Git from the live
                         server

                    • Automate the adding of them e.g. with a
                         WordPress hook

                    • Which solution depends on the nature of
                         your images



Friday, 23 November 12                                               30
Plugin/core
                          upgrades




Friday, 23 November 12                 31
Plugin/core
                                upgrades
                    • If they happen on live, you’ll end up
                         with untracked files/uncommitted
                         changes to your live files




Friday, 23 November 12                                        31
Plugin/core
                                upgrades
                    • If they happen on live, you’ll end up
                         with untracked files/uncommitted
                         changes to your live files

                    • Doing them on live is insane
                         regardless, so it makes double sense
                         to stop doing it



Friday, 23 November 12                                          31
Solutions




Friday, 23 November 12               32
Solutions
                    • Disable upgrades/plugin installs on your live
                         sites, do upgrades locally, then deploy to live




Friday, 23 November 12                                                     32
Solutions
                    • Disable upgrades/plugin installs on your live
                         sites, do upgrades locally, then deploy to live

                    • Remove install_plugins, install_themes,
                         update_plugins, update_themes, update_core
                         capabilities from your users on live




Friday, 23 November 12                                                     32
Solutions
                    • Disable upgrades/plugin installs on your live
                         sites, do upgrades locally, then deploy to live

                    • Remove install_plugins, install_themes,
                         update_plugins, update_themes, update_core
                         capabilities from your users on live

                    • define('DISALLOW_FILE_EDIT', true); in
                         your live wp-config.php



Friday, 23 November 12                                                     32
Useful resources
                    •    “Think Like a Git”: http://think-like-a-git.net/

                    •    GitRef: http://gitref.org/

                    •    ProGit: http://git-scm.com/book

                    •    Useful Git tips: http://mislav.uniqpath.com/2010/07/git-tips/

                    •    “So, I’ve tried Git” by Ozh http://planetozh.com/blog/2012/11/so-
                         ive-tried-git-and-its/

                    •    Migrating an SVN repo to Git: http://john.albin.net/git/convert-
                         subversion-to-git




Friday, 23 November 12                                                                       33
Git GUIs




Friday, 23 November 12              34
Git GUIs

                    • Use the command line first!




Friday, 23 November 12                              34
Git GUIs

                    • Use the command line first!
                    • But on Windows: Tortoise Git



Friday, 23 November 12                               34
Git GUIs

                    • Use the command line first!
                    • But on Windows: Tortoise Git
                    • On OS X: Tower, GitBox, Gitti


Friday, 23 November 12                                34
Git GUIs

                    • Use the command line first!
                    • But on Windows: Tortoise Git
                    • On OS X: Tower, GitBox, Gitti
                    • On Linux: giggle, gitg, QGit

Friday, 23 November 12                                34
And finally…




Friday, 23 November 12                  35
And finally…




Friday, 23 November 12                  35
And finally…
                    • Jeff’s leaving! :(




Friday, 23 November 12                       35
And finally…
                    • Jeff’s leaving! :(
                    • We’re hiring! :)




Friday, 23 November 12                       35
And finally…
                    • Jeff’s leaving! :(
                    • We’re hiring! :)
                    • Apply online:
                         http://bit.ly/SZJJ8v

                         or email:
                         rob@bigfish.co.uk




Friday, 23 November 12                          35

Weitere ähnliche Inhalte

Kürzlich hochgeladen

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave 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
 
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
 
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
 
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
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
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
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
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
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
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
 

Kürzlich hochgeladen (20)

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave 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...
 
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
 
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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
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)
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
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
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
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
 

Empfohlen

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Empfohlen (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Developing with WordPress and Git

  • 1. Developing with WordPress and Git Rob Miller • @robmil Big Fish Design Friday, 23 November 12 1
  • 3. “Git”? Huh? What’s that? Friday, 23 November 12 3
  • 4. “Git”? Huh? What’s that? • A distributed version control system Friday, 23 November 12 3
  • 5. “Git”? Huh? What’s that? • A distributed version control system • Free Friday, 23 November 12 3
  • 6. “Git”? Huh? What’s that? • A distributed version control system • Free • Open source Friday, 23 November 12 3
  • 7. “Git”? Huh? What’s that? • A distributed version control system • Free • Open source • Popular Friday, 23 November 12 3
  • 8. A crash course in version control Friday, 23 November 12 4
  • 9. What is version control? Friday, 23 November 12 5
  • 10. What is version control? • Track changes made to source code Friday, 23 November 12 5
  • 11. What is version control? • Track changes made to source code • Who did what and when Friday, 23 November 12 5
  • 12. What is version control? • Track changes made to source code • Who did what and when • When things break, revert to the point when it last worked Friday, 23 November 12 5
  • 13. What is version control? • Track changes made to source code • Who did what and when • When things break, revert to the point when it last worked • Like Time Machine for your website’s code (but not database/content…) Friday, 23 November 12 5
  • 14. Why version control? Friday, 23 November 12 6
  • 15. Why version control? • “I just deleted a file by mistake — can we get it back?” Friday, 23 November 12 6
  • 16. Why version control? • “I just deleted a file by mistake — can we get it back?” • “I need to know who made this change — can we find out?” Friday, 23 November 12 6
  • 17. Why version control? • “I just deleted a file by mistake — can we get it back?” • “I need to know who made this change — can we find out?” • “That feature just broke the site — can we revert it?” Friday, 23 November 12 6
  • 18. Why version control? • “I just deleted a file by mistake — can we get it back?” • “I need to know who made this change — can we find out?” • “That feature just broke the site — can we revert it?” • “There’s a bug that didn’t use to exist. When was it introduced?” Friday, 23 November 12 6
  • 19. Centralised vs. distributed Friday, 23 November 12 7
  • 20. Centralised version control Friday, 23 November 12 8
  • 21. Centralised version control • History stored in a central repository running on a server Friday, 23 November 12 8
  • 22. Centralised version control • History stored in a central repository running on a server • Everyone commits to and from this repository Friday, 23 November 12 8
  • 23. Centralised version control • History stored in a central repository running on a server • Everyone commits to and from this repository • Examples: CVS, Subversion (SVN), Perforce, ClearCase Friday, 23 November 12 8
  • 24. Distributed version control Friday, 23 November 12 9
  • 25. Distributed version control • No central server Friday, 23 November 12 9
  • 26. Distributed version control • No central server • Every team member has a copy of the entire repository and its history Friday, 23 November 12 9
  • 27. Distributed version control • No central server • Every team member has a copy of the entire repository and its history • Git isn’t the only option — e.g. Mercurial Friday, 23 November 12 9
  • 28. Advantages of DVCS Friday, 23 November 12 10
  • 29. Advantages of DVCS • Redundancy Friday, 23 November 12 10
  • 30. Advantages of DVCS • Redundancy • Offline working Friday, 23 November 12 10
  • 31. Advantages of DVCS • Redundancy • Offline working • Speed Friday, 23 November 12 10
  • 33. Git ≠ GitHub Friday, 23 November 12 12
  • 34. Terminology, part one Friday, 23 November 12 13
  • 35. Terminology, part one • Commit Friday, 23 November 12 13
  • 36. Terminology, part one • Commit • Branch Friday, 23 November 12 13
  • 37. Terminology, part one • Commit • Branch • Tag Friday, 23 November 12 13
  • 38. Terminology, part one • Commit • Branch • Tag • Diff Friday, 23 November 12 13
  • 39. Terminology, part one • Commit • Branch • Tag • Diff • Commitish Friday, 23 November 12 13
  • 40. Terminology, part two Friday, 23 November 12 14
  • 41. Terminology, part two • Pulling Friday, 23 November 12 14
  • 42. Terminology, part two • Pulling • Pushing Friday, 23 November 12 14
  • 43. Terminology, part two • Pulling • Pushing • Cloning Friday, 23 November 12 14
  • 44. What’s in a Git commit? Friday, 23 November 12 15
  • 45. What’s in a Git commit? Friday, 23 November 12 15
  • 46. What’s in a Git commit? Friday, 23 November 12 15
  • 47. What’s in a Git commit? Friday, 23 November 12 15
  • 48. What’s in a Git commit? Friday, 23 November 12 15
  • 50. Branches • In Subversion, they’re basically useless Friday, 23 November 12 16
  • 51. Branches • In Subversion, they’re basically useless • In Git, they’re at the heart of almost everything Friday, 23 November 12 16
  • 52. Branches • In Subversion, they’re basically useless • In Git, they’re at the heart of almost everything • Juggle as many different versions of your code as you like Friday, 23 November 12 16
  • 53. Branches • In Subversion, they’re basically useless • In Git, they’re at the heart of almost everything • Juggle as many different versions of your code as you like • Keep all your features nice and separate Friday, 23 November 12 16
  • 54. Branches • In Subversion, they’re basically useless • In Git, they’re at the heart of almost everything • Juggle as many different versions of your code as you like • Keep all your features nice and separate • Merge painlessly once you’re done Friday, 23 November 12 16
  • 55. Special branch Friday, 23 November 12 17
  • 56. Special branch • Git doesn’t force you to have any particular branches Friday, 23 November 12 17
  • 57. Special branch • Git doesn’t force you to have any particular branches • But by convention, master is your stable branch Friday, 23 November 12 17
  • 58. Special branch • Git doesn’t force you to have any particular branches • But by convention, master is your stable branch • Branch from it; merge to it; your releases are taken from it Friday, 23 November 12 17
  • 59. Branch commands Friday, 23 November 12 18
  • 60. Branch commands • git branch foo will create a branch called “foo”. Friday, 23 November 12 18
  • 61. Branch commands • git branch foo will create a branch called “foo”. • git checkout bar will switch to the branch called “bar” Friday, 23 November 12 18
  • 62. Branch commands • git branch foo will create a branch called “foo”. • git checkout bar will switch to the branch called “bar” • git branch -d foo will delete a branch if you change your mind about it Friday, 23 November 12 18
  • 64. Merging • Once you’re done with a branch, you can merge it into another: $ git checkout master $ git merge --no-ff foo Friday, 23 November 12 19
  • 65. When should you branch? Friday, 23 November 12 20
  • 66. When should you branch? • For individual features Friday, 23 November 12 20
  • 67. When should you branch? • For individual features • What does that mean, though? Friday, 23 November 12 20
  • 68. When should you branch? • For individual features • What does that mean, though? • Generally: anything that might be put live independently Friday, 23 November 12 20
  • 69. Setting up a repository Friday, 23 November 12 21
  • 71. $ git init Friday, 23 November 12 22
  • 72. Working with a team Friday, 23 November 12 23
  • 73. A typical team setup Friday, 23 November 12 24
  • 74. A typical team setup You Friday, 23 November 12 24
  • 75. A typical team setup You The rest of the team Friday, 23 November 12 24
  • 76. A typical team setup Hub You The rest of the team Friday, 23 November 12 24
  • 77. A typical team setup Hub You Staging The rest of the team Friday, 23 November 12 24
  • 78. A typical team setup Hub You Production Staging The rest of the team Friday, 23 November 12 24
  • 81. • Scripts that run after certain events — just like actions in WordPress Friday, 23 November 12 26
  • 82. • Scripts that run after certain events — just like actions in WordPress • Potential uses: Friday, 23 November 12 26
  • 83. • Scripts that run after certain events — just like actions in WordPress • Potential uses: • Post a message in an IRC channel when someone pushes Friday, 23 November 12 26
  • 84. • Scripts that run after certain events — just like actions in WordPress • Potential uses: • Post a message in an IRC channel when someone pushes • Deploy to the live site when someone pushes on master Friday, 23 November 12 26
  • 85. • Scripts that run after certain events — just like actions in WordPress • Potential uses: • Post a message in an IRC channel when someone pushes • Deploy to the live site when someone pushes on master • Run a syntax checker/strip whitespace/etc. before commits Friday, 23 November 12 26
  • 86. Git and WordPress Friday, 23 November 12 27
  • 87. Things to exclude Friday, 23 November 12 28
  • 88. Things to exclude • wp-config.php Friday, 23 November 12 28
  • 89. Things to exclude • wp-config.php • wp-uploads/* (or perhaps not…) Friday, 23 November 12 28
  • 90. Things to exclude • wp-config.php • wp-uploads/* (or perhaps not…) • Anything that might conceivably be different on live vs. development Friday, 23 November 12 28
  • 91. Image uploads Friday, 23 November 12 29
  • 92. Image uploads • Image uploads inevitably happen on live Friday, 23 November 12 29
  • 93. Image uploads • Image uploads inevitably happen on live • Are they content (so should be excluded from Git)? Friday, 23 November 12 29
  • 94. Image uploads • Image uploads inevitably happen on live • Are they content (so should be excluded from Git)? • Or are they layout/template related (so should be included in Git)? Friday, 23 November 12 29
  • 96. Potential solutions • Ignore them — don’t have them in Git at all Friday, 23 November 12 30
  • 97. Potential solutions • Ignore them — don’t have them in Git at all • Periodically add them into Git from the live server Friday, 23 November 12 30
  • 98. Potential solutions • Ignore them — don’t have them in Git at all • Periodically add them into Git from the live server • Automate the adding of them e.g. with a WordPress hook Friday, 23 November 12 30
  • 99. Potential solutions • Ignore them — don’t have them in Git at all • Periodically add them into Git from the live server • Automate the adding of them e.g. with a WordPress hook • Which solution depends on the nature of your images Friday, 23 November 12 30
  • 100. Plugin/core upgrades Friday, 23 November 12 31
  • 101. Plugin/core upgrades • If they happen on live, you’ll end up with untracked files/uncommitted changes to your live files Friday, 23 November 12 31
  • 102. Plugin/core upgrades • If they happen on live, you’ll end up with untracked files/uncommitted changes to your live files • Doing them on live is insane regardless, so it makes double sense to stop doing it Friday, 23 November 12 31
  • 104. Solutions • Disable upgrades/plugin installs on your live sites, do upgrades locally, then deploy to live Friday, 23 November 12 32
  • 105. Solutions • Disable upgrades/plugin installs on your live sites, do upgrades locally, then deploy to live • Remove install_plugins, install_themes, update_plugins, update_themes, update_core capabilities from your users on live Friday, 23 November 12 32
  • 106. Solutions • Disable upgrades/plugin installs on your live sites, do upgrades locally, then deploy to live • Remove install_plugins, install_themes, update_plugins, update_themes, update_core capabilities from your users on live • define('DISALLOW_FILE_EDIT', true); in your live wp-config.php Friday, 23 November 12 32
  • 107. Useful resources • “Think Like a Git”: http://think-like-a-git.net/ • GitRef: http://gitref.org/ • ProGit: http://git-scm.com/book • Useful Git tips: http://mislav.uniqpath.com/2010/07/git-tips/ • “So, I’ve tried Git” by Ozh http://planetozh.com/blog/2012/11/so- ive-tried-git-and-its/ • Migrating an SVN repo to Git: http://john.albin.net/git/convert- subversion-to-git Friday, 23 November 12 33
  • 108. Git GUIs Friday, 23 November 12 34
  • 109. Git GUIs • Use the command line first! Friday, 23 November 12 34
  • 110. Git GUIs • Use the command line first! • But on Windows: Tortoise Git Friday, 23 November 12 34
  • 111. Git GUIs • Use the command line first! • But on Windows: Tortoise Git • On OS X: Tower, GitBox, Gitti Friday, 23 November 12 34
  • 112. Git GUIs • Use the command line first! • But on Windows: Tortoise Git • On OS X: Tower, GitBox, Gitti • On Linux: giggle, gitg, QGit Friday, 23 November 12 34
  • 113. And finally… Friday, 23 November 12 35
  • 114. And finally… Friday, 23 November 12 35
  • 115. And finally… • Jeff’s leaving! :( Friday, 23 November 12 35
  • 116. And finally… • Jeff’s leaving! :( • We’re hiring! :) Friday, 23 November 12 35
  • 117. And finally… • Jeff’s leaving! :( • We’re hiring! :) • Apply online: http://bit.ly/SZJJ8v or email: rob@bigfish.co.uk Friday, 23 November 12 35