SlideShare a Scribd company logo
Less ‘Oh Sh*t’ With GIT
              How having a GIT-based workflow can make your life infinitely easier




Wednesday, 16 May 12
What with a who-now?
                         • Who the hell are you?
                         • What the hell are you
                           talking about?

                         • What the hell is a
                           ‘Workflow’ ?

                         • What the hell is
                           ‘GIT’?

                         • Oh. Why the hell am I
                           not using this thing?


                                                   2

Wednesday, 16 May 12
Who the hell are you?
                          • Richard Tape
                          • Sticky, sello, masking,
                             video, worm. You’re
                             welcome

                          • Working with WP
                             professionally for >3
                             years. Thanks Mike!

                          • @RichardTape
                          • http://rich.is/ (coming
                             soon) but have site at
                             http://iamfriendly.com/




                                                       3

Wednesday, 16 May 12
!important
                         • Here’s what I’m not
                           saying:
                           ★   That my WorkFlow is the One
                               True Way ©


                           ★   That what I do is ‘right’


                           ★   That you should copy what I do
                               without having a basic
                               understanding of what you’re
                               doing

                           ★   Manchester City deserved to
                               win the Premiership Title this
                               year




                                                                4

Wednesday, 16 May 12
What the hell are you talking
            about, then?

            • What is a Workflow and why do I need one?
            • Richard, what were you doing this time last year?
            • Haha. That’s ridiculous. You’re an idiot. What are you doing now,
                   though?

            • But I already have my way of doing things and it works great.
                   When do you stop talking? You’re boring.

            • OK, OK, as it’d apparently be ‘rude’ if I got up and left, you might
                   as well tell me about this ‘GIT’ thing. ENTERTAIN ME.


                                                                                     5

Wednesday, 16 May 12
What is a Workflow?
                You’re going to crack out a dictionary definition aren’t you?
                You’re so predictable.

                1. The scheduling of independent jobs on a computer.


                2.  The set of relationships between all the activities in a
                project, from start to finish. Activities are related by different
                types of trigger relation. Activities may be triggered by
                external events or by other activities.

                3. The movement of documents around an organisation for
                purposes including sign-off, evaluation, performing activities
                in a process and co-writing.

                                                                                    6

Wednesday, 16 May 12
And in English, please?

                How you go about your day-to-day
                 tasks and the systems you put in
                place to allow you to do those tasks
                             more easily



                                                       7

Wednesday, 16 May 12
Richard, what were you doing
            this time last year?

            • Work locally using a MAMP setup.
            • WordPress Multisite installation, each ‘project’ was a new
                   site.
            • When happy with work, sFTP to live site. Cross fingers and
                   sacrifice a goat in the hope that it wouldn’t break.

            • For edits: either edit file locally and re-upload or, if I was in
                   a rush, edit the file on the live server. Yes, I’m going straight
                   to hell.

            • For database: local and live sites were entirely separate.


                                                                                      8

Wednesday, 16 May 12
Wednesday, 16 May 12
Live file
            editing?
             Hahaha. HAHAHAHA.
             AAAAHAHAHAHAHA.

             You’re an idiot.




             (Secretly, I sometimes do this too. But don’t tell
             anyone)




Wednesday, 16 May 12
What are you doing now?
            • All source files (including WP core) are version controlled
                   in GIT - stored in local repos and on github

            • I make all edits locally (even though I am sysadmin on my
                   live server, I have intentionally revoked my rights to edit
                   files directly)

            • Commit to local git repo. Push to github.
            • Post Commit hooks on github automatically pulls all edits
                   onto staging server

            • If happy on staging, deploy changes to live

                                                                                 11

Wednesday, 16 May 12
GIT? Repo? Staging? Deploy?
            • GIT is a VCS - a version control system (a ‘distributed’ one
                   at that) and source code management (SCM)
                   ★   It keeps track of all changes you make to your files
                   ★   You can think of it like the Revisions System in WordPress




             • Repo is short for Repository.
                   ★   It’s sort of like a database
                   ★   When you make changes to your files, you ‘commit’ them to your local repo
                   ★   If you have made a mistake, you can simply ‘roll back’ to a previous state
                   ★   Sort of like an ‘undo’ feature for all of your files




                                                                                                    12

Wednesday, 16 May 12
GIT? Repo? Staging? Deploy?
            • Staging
                   ★   An intermediary between your local environment and the live site
                   ★   Ideally, the staging server and the live server have identical setups
                   ★   Means you can see exactly what your changes will look like on the live site without the
                       panic of ‘guessing’




             • Deploy
                   ★   The equivalent of FTP’ing all your changes elsewhere

                   ★   When you ‘deploy’ something you’re effectively “making it live”




                                                                                                                 13

Wednesday, 16 May 12
Hang on. So you don’t FTP?
            Anything?

            • Nope. Not a sausage.

             • If I need to install a plugin I do it locally. Then commit and
                   push to github.

             • This then automatically grabs all files to the staging server
                   (which means FTP is disabled on my server so (a little)
                   more secure.

             • Likewise with themes.



                                                                                14

Wednesday, 16 May 12
Iiiinteresting. Veeeery
            interesting.
                                      15

Wednesday, 16 May 12
OK smart-arse, what about
            content?

            • Content is a little more complicated

             • Text is stored in a database, so no ‘flat files’ as such (there
                   is, kinda, but it’s complicated and not for now)

             • Can do a ‘database dump’ change references to ‘local’
                   environment and replace with links to live site

             • Or...

             • RAMP Plugin by Crowd Favorite
                   http://crowdfavorite.com/wordpress/ramp/

                                                                               16

Wednesday, 16 May 12
17

Wednesday, 16 May 12
Holy Frack. How Much?!
            • Yeah, it’s not cheap. But it does a great job.

            • Also, it has a developer API, so all of the themes and plugins
                   that I develop are ‘RAMP-enabled’ which mean that any
                   user of said themes or plugins can benefit from RAMP’s
                   content management


             • Free Alternative: DeployMint by Mark Maunder
                   http://code.google.com/p/deploymint/




                                                                               18

Wednesday, 16 May 12
Care to
            show me an
            example?
              This can only go well




Wednesday, 16 May 12
OH GOD!
            THE
            CONSOLE
            • You don’t have to use
                   the console, there are
                   several apps you can
                   use

            • Tower or github for
                   mac

            • GIT Gui / TortoiseGIT
                   for Windows



Wednesday, 16 May 12
But I work
                       in a team?
                       • On some projects, so
                         do I!

                       • Different people have
                         their own ‘local’
                         repository and work
                         on different branches

                       • These are then
                         ‘merged’ as and when


                                                 21

Wednesday, 16 May 12
What about backups?
            • Well, because your code is all stored on GitHub, you already
                   have 1 level of backup. RAMP handles media, too.

            • For the database, I use a plugin called BackupPress (http://
                   www.getbackuppress.com) - it ‘just works’ and allows you to
                   restore your database back to a previous state if things go
                   awry

            • Alternative: WP-DBManager (https://wordpress.org/
                   extend/plugins/wp-dbmanager/)

            • I also have a cron job on my server which does a dump twice
                   a day.

                                                                                 22

Wednesday, 16 May 12
I’ve forgotten absolutely
            everything you’ve just said

            • Having a workflow you are both comfortable with and that
                   you stick to is more important than what the workflow
                   actually is

            • Use a Version Control System; they will - after a small
                   learning curve - become a God-send

            • Never, ever edit files on a live server. Ever. Forever, ever.
             • Have a fallback plan
             • Don’t just jump straight into something - do some reading
                   about it first, understand it, then take small steps


                                                                             23

Wednesday, 16 May 12
Wednesday, 16 May 12
Credits
            •      http://bit.ly/JDjfYd

            •      http://bit.ly/L3Z3vL

            •      http://bit.ly/K3NJAZ

            •      http://bit.ly/L44VF3

            •      http://bit.ly/JtUO25

            •      http://bit.ly/JSTJz1

            •      http://bit.ly/IXPLRE

            •      http://bit.ly/Kt1NaX

            •      http://bit.ly/J85QZK

            •      http://bit.ly/L6md4t

            •      http://bit.ly/LScNN4

            •      http://bit.ly/JJdes2



Wednesday, 16 May 12

More Related Content

PDF
David Leininger - Capturing Your Audience with Mobility
PDF
Cloud Adoption Trends 2012
PPT
Prezentacja dr. Pawła Kuczyńskiego | anty-ACTA
PPT
Bioinformatics Core Services, the IBMCP case
PPT
Tlc en ee.uu y colombia
PPTX
PPTX
substance abuse counselor
ODP
Aliments fruites i animals
David Leininger - Capturing Your Audience with Mobility
Cloud Adoption Trends 2012
Prezentacja dr. Pawła Kuczyńskiego | anty-ACTA
Bioinformatics Core Services, the IBMCP case
Tlc en ee.uu y colombia
substance abuse counselor
Aliments fruites i animals

Viewers also liked (18)

PPTX
Payforit4 Training
PDF
Vescina accountability dei confidi minori 7 aprile
PDF
LARIS Indonesia
PPTX
Payforit 4 Case Study
KEY
Are you paying attention?
PPTX
European banking presentation 20.04.2012
PDF
Revista PM Network
PPTX
European banking presentation 20.04.2012
PPTX
The big bang theory !!!
PPTX
Presentation1
PPTX
Isas report
PPTX
UESJLS-Baratau-PrimeroA-ExamenPrimerTrimestre
PDF
LARIS Property (www.LarisIndonesia.com)
PPTX
Task 2 writing 105
PPTX
Isas _Q3 _Soft_Topic3_enterprise_application_architecture
PPTX
Payforit 4 Seminar
PDF
GFC - Magazine article
PPTX
งานนำเสนอ1
Payforit4 Training
Vescina accountability dei confidi minori 7 aprile
LARIS Indonesia
Payforit 4 Case Study
Are you paying attention?
European banking presentation 20.04.2012
Revista PM Network
European banking presentation 20.04.2012
The big bang theory !!!
Presentation1
Isas report
UESJLS-Baratau-PrimeroA-ExamenPrimerTrimestre
LARIS Property (www.LarisIndonesia.com)
Task 2 writing 105
Isas _Q3 _Soft_Topic3_enterprise_application_architecture
Payforit 4 Seminar
GFC - Magazine article
งานนำเสนอ1
Ad

Similar to Less oh-shit with git (20)

KEY
Less 'Oh Shit' With GIT
PDF
Go with the Flow - A Guide to a WordPress Workflow
PDF
Go with the Flow - A Guide to a WordPress Workflow
PDF
Version Control with Git
PDF
Don't Panic: A Hitchhiker's Guide to WordPress Hosting 08 25-2012
PDF
.Git for WordPress Developers
PDF
Git Makes Me Angry Inside
PDF
WordPress & Version Control: A Workflow
PDF
GIT Introduction
PDF
Intro to Git
PDF
Git tutorial
PDF
457 WWDC08 Student Welcome
KEY
Open Hack Taiwan 2012 - Hacking 101
PDF
WordPress and Git
PDF
Introduction to Git
PPTX
Open Source Project Management
PPTX
Using Git with WordPress - Presented by Nigel Rodgers.
PPTX
WordCamp Asheville 2014: WordPress and Git
PPTX
Source control - what you need to know
PPT
Working with WordPress in a Team Environment
Less 'Oh Shit' With GIT
Go with the Flow - A Guide to a WordPress Workflow
Go with the Flow - A Guide to a WordPress Workflow
Version Control with Git
Don't Panic: A Hitchhiker's Guide to WordPress Hosting 08 25-2012
.Git for WordPress Developers
Git Makes Me Angry Inside
WordPress & Version Control: A Workflow
GIT Introduction
Intro to Git
Git tutorial
457 WWDC08 Student Welcome
Open Hack Taiwan 2012 - Hacking 101
WordPress and Git
Introduction to Git
Open Source Project Management
Using Git with WordPress - Presented by Nigel Rodgers.
WordCamp Asheville 2014: WordPress and Git
Source control - what you need to know
Working with WordPress in a Team Environment
Ad

Recently uploaded (20)

PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Cloud computing and distributed systems.
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPT
Teaching material agriculture food technology
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
sap open course for s4hana steps from ECC to s4
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
MYSQL Presentation for SQL database connectivity
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Encapsulation theory and applications.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
Cloud computing and distributed systems.
Building Integrated photovoltaic BIPV_UPV.pdf
Big Data Technologies - Introduction.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Teaching material agriculture food technology
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
sap open course for s4hana steps from ECC to s4
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Per capita expenditure prediction using model stacking based on satellite ima...
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
20250228 LYD VKU AI Blended-Learning.pptx
Dropbox Q2 2025 Financial Results & Investor Presentation
MYSQL Presentation for SQL database connectivity
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Spectral efficient network and resource selection model in 5G networks
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Encapsulation theory and applications.pdf

Less oh-shit with git

  • 1. Less ‘Oh Sh*t’ With GIT How having a GIT-based workflow can make your life infinitely easier Wednesday, 16 May 12
  • 2. What with a who-now? • Who the hell are you? • What the hell are you talking about? • What the hell is a ‘Workflow’ ? • What the hell is ‘GIT’? • Oh. Why the hell am I not using this thing? 2 Wednesday, 16 May 12
  • 3. Who the hell are you? • Richard Tape • Sticky, sello, masking, video, worm. You’re welcome • Working with WP professionally for >3 years. Thanks Mike! • @RichardTape • http://rich.is/ (coming soon) but have site at http://iamfriendly.com/ 3 Wednesday, 16 May 12
  • 4. !important • Here’s what I’m not saying: ★ That my WorkFlow is the One True Way © ★ That what I do is ‘right’ ★ That you should copy what I do without having a basic understanding of what you’re doing ★ Manchester City deserved to win the Premiership Title this year 4 Wednesday, 16 May 12
  • 5. What the hell are you talking about, then? • What is a Workflow and why do I need one? • Richard, what were you doing this time last year? • Haha. That’s ridiculous. You’re an idiot. What are you doing now, though? • But I already have my way of doing things and it works great. When do you stop talking? You’re boring. • OK, OK, as it’d apparently be ‘rude’ if I got up and left, you might as well tell me about this ‘GIT’ thing. ENTERTAIN ME. 5 Wednesday, 16 May 12
  • 6. What is a Workflow? You’re going to crack out a dictionary definition aren’t you? You’re so predictable. 1. The scheduling of independent jobs on a computer. 2.  The set of relationships between all the activities in a project, from start to finish. Activities are related by different types of trigger relation. Activities may be triggered by external events or by other activities. 3. The movement of documents around an organisation for purposes including sign-off, evaluation, performing activities in a process and co-writing. 6 Wednesday, 16 May 12
  • 7. And in English, please? How you go about your day-to-day tasks and the systems you put in place to allow you to do those tasks more easily 7 Wednesday, 16 May 12
  • 8. Richard, what were you doing this time last year? • Work locally using a MAMP setup. • WordPress Multisite installation, each ‘project’ was a new site. • When happy with work, sFTP to live site. Cross fingers and sacrifice a goat in the hope that it wouldn’t break. • For edits: either edit file locally and re-upload or, if I was in a rush, edit the file on the live server. Yes, I’m going straight to hell. • For database: local and live sites were entirely separate. 8 Wednesday, 16 May 12
  • 10. Live file editing? Hahaha. HAHAHAHA. AAAAHAHAHAHAHA. You’re an idiot. (Secretly, I sometimes do this too. But don’t tell anyone) Wednesday, 16 May 12
  • 11. What are you doing now? • All source files (including WP core) are version controlled in GIT - stored in local repos and on github • I make all edits locally (even though I am sysadmin on my live server, I have intentionally revoked my rights to edit files directly) • Commit to local git repo. Push to github. • Post Commit hooks on github automatically pulls all edits onto staging server • If happy on staging, deploy changes to live 11 Wednesday, 16 May 12
  • 12. GIT? Repo? Staging? Deploy? • GIT is a VCS - a version control system (a ‘distributed’ one at that) and source code management (SCM) ★ It keeps track of all changes you make to your files ★ You can think of it like the Revisions System in WordPress • Repo is short for Repository. ★ It’s sort of like a database ★ When you make changes to your files, you ‘commit’ them to your local repo ★ If you have made a mistake, you can simply ‘roll back’ to a previous state ★ Sort of like an ‘undo’ feature for all of your files 12 Wednesday, 16 May 12
  • 13. GIT? Repo? Staging? Deploy? • Staging ★ An intermediary between your local environment and the live site ★ Ideally, the staging server and the live server have identical setups ★ Means you can see exactly what your changes will look like on the live site without the panic of ‘guessing’ • Deploy ★ The equivalent of FTP’ing all your changes elsewhere ★ When you ‘deploy’ something you’re effectively “making it live” 13 Wednesday, 16 May 12
  • 14. Hang on. So you don’t FTP? Anything? • Nope. Not a sausage. • If I need to install a plugin I do it locally. Then commit and push to github. • This then automatically grabs all files to the staging server (which means FTP is disabled on my server so (a little) more secure. • Likewise with themes. 14 Wednesday, 16 May 12
  • 15. Iiiinteresting. Veeeery interesting. 15 Wednesday, 16 May 12
  • 16. OK smart-arse, what about content? • Content is a little more complicated • Text is stored in a database, so no ‘flat files’ as such (there is, kinda, but it’s complicated and not for now) • Can do a ‘database dump’ change references to ‘local’ environment and replace with links to live site • Or... • RAMP Plugin by Crowd Favorite http://crowdfavorite.com/wordpress/ramp/ 16 Wednesday, 16 May 12
  • 18. Holy Frack. How Much?! • Yeah, it’s not cheap. But it does a great job. • Also, it has a developer API, so all of the themes and plugins that I develop are ‘RAMP-enabled’ which mean that any user of said themes or plugins can benefit from RAMP’s content management • Free Alternative: DeployMint by Mark Maunder http://code.google.com/p/deploymint/ 18 Wednesday, 16 May 12
  • 19. Care to show me an example? This can only go well Wednesday, 16 May 12
  • 20. OH GOD! THE CONSOLE • You don’t have to use the console, there are several apps you can use • Tower or github for mac • GIT Gui / TortoiseGIT for Windows Wednesday, 16 May 12
  • 21. But I work in a team? • On some projects, so do I! • Different people have their own ‘local’ repository and work on different branches • These are then ‘merged’ as and when 21 Wednesday, 16 May 12
  • 22. What about backups? • Well, because your code is all stored on GitHub, you already have 1 level of backup. RAMP handles media, too. • For the database, I use a plugin called BackupPress (http:// www.getbackuppress.com) - it ‘just works’ and allows you to restore your database back to a previous state if things go awry • Alternative: WP-DBManager (https://wordpress.org/ extend/plugins/wp-dbmanager/) • I also have a cron job on my server which does a dump twice a day. 22 Wednesday, 16 May 12
  • 23. I’ve forgotten absolutely everything you’ve just said • Having a workflow you are both comfortable with and that you stick to is more important than what the workflow actually is • Use a Version Control System; they will - after a small learning curve - become a God-send • Never, ever edit files on a live server. Ever. Forever, ever. • Have a fallback plan • Don’t just jump straight into something - do some reading about it first, understand it, then take small steps 23 Wednesday, 16 May 12
  • 25. Credits • http://bit.ly/JDjfYd • http://bit.ly/L3Z3vL • http://bit.ly/K3NJAZ • http://bit.ly/L44VF3 • http://bit.ly/JtUO25 • http://bit.ly/JSTJz1 • http://bit.ly/IXPLRE • http://bit.ly/Kt1NaX • http://bit.ly/J85QZK • http://bit.ly/L6md4t • http://bit.ly/LScNN4 • http://bit.ly/JJdes2 Wednesday, 16 May 12