SlideShare a Scribd company logo
1 of 28
Download to read offline
.Git Wah?
Everyting you wanted to know about .Git but were
                  afraid to ask?
Mike Van Winkle

• Developer @ WP Engine
• Freelance WordPress Developer for 3 years
• Second career
• Santa Rosa, CA
Utopia

• I write perfect code.
• I upload perfect code to website.
• Nobody touches my perfect code without
  asking me first.
• Rinse and Repeat.
Reality

• Other developers on a project
• I do stupid things
• Clients sometimes think they can code
• Shit happens
Version Control


• The Problem: How do we maintain stability
  and continuity in our websites/applications?
• The Answer: We save versions.
Realistic Workflow




   http://nvie.com/posts/a-successful-git-branching-model/
Realistic Workflow




   http://nvie.com/posts/a-successful-git-branching-model/
Version Control

• As much about transitioning a website
  between states as it is recording changes.
• Deployment is quicker and safer.
• Changes can be easily “rolled” back.
• A google example
Subversion or .Git

• SVN solves the problem by saving a
  “revision” with each change committed.
  Developers then can update code to a
  specific #
• Git Solves the problem by tracking the
  differences between commits
Subversion or .Git
• .Git is a “distributed” model with less
  server overhead and better performance
• .Git makes complex workflows much easier
  to manage
• Github.com is a great community of
  projects and developers sharing code.
• Little functions that make life easy
  (examples later)
Getting Started:What
      you need

• A command line tool like iTerm or Putty
• RSA Key Pair: https://help.github.com/articles/generating-ssh-keys




• Some Code
Getting Started: Set up
        a repo
Getting Started: Set up
        a repo
Getting Started:Then
       What?
$ git init
[create a .gitignore file ... touch .gitignore ]
$ git add . --all OR $ git add wp-content
$ git add remote origin
git@github.com:mikevanwinkle/My-WP-Site.git
git commit -am “initial commit”
git push origin master
What to ignore?
• Large Files
• Local Files
   • custom .htaccess files
   • custom wp-config.php
 • WP Core
 • Folders containing .svn info
 • Historic Files
What to ignore?
*~                    wp-content/upgrade/*         .htaccess ?
.svn                  wp-content/uploads           wp-config.php ?
.cvs                  wp-content/blogs.dir/*/*
.git                  pclzip-*
.listing              log.txt
*.bak                 debug.log
*.swp                 gallery/*
cache                 wp-content/gallery/*
.cache                wp-content/album/*
temp                  wp-content/plugins/plugins
tmp
*.tmp
imagecache*
uploads*
*_backup
wp-config-sample.php
wp-content/w3tc*
wp-content/w3-*
Deployment

On your webhost, you’ll need ssh access or you will
need a tool that can deploy via FTP ( Beanstalk ? )
$ git clone git@github.com:mikevanwinkle/My-WP-
Site.git
$ git pull origin master
Development: Example
[on your local]

$ git branch dev

$ git checkout dev

[make some changes]

$ git commit -am “Making my dev changes”

$ git push origin dev [pushes the new branch up]

[on production site]

$ git pull origin dev

$ git checkout dev
Development: Example
[on your local]

$ git branch feature-1

$ git checkout feature-1

[make some changes]

$ git commit -am “Making my dev changes”

$ git push origin feature-1 [pushes the new branch up]

$ git checkout master

$ git merge feature-1

$ git commit -am “merge feature-1 with master”

$ git push origin master
Realistic Workflow
Realistic Workflow
Cool Stuff: Hooks
•   applypatch-msg

•   post-commit

•   post-update

•   pre-commit

•   update

•   commit-msg

•   post-receive

•   pre-applypatch

•   pre-rebase
Cool Stuff: Stash
•   applypatch-msg

•   post-commit

•   post-update

•   pre-commit

•   update

•   commit-msg

•   post-receive

•   pre-applypatch

•   pre-rebase
Cool Stuff: Stash

$ git stash save “Temp 2”

$ git stash list

$ git stash apply <STASH ID>

http://git-scm.com/book/en/Git-Tools-Stashing
Cool Stuff: Reset


$ git reset --hard HEAD
Cool Stuff: Reset


$ git reset --hard HEAD
Cool Stuff: Archive


$ git archive HEAD | gzip > /tmp/
website.tar.gz
Resources

http://rkulla.blogspot.com/2011/08/some-points-on-git-vs-subversion.html

http://ryanflorence.com/deploying-websites-with-a-tiny-git-hook/

http://git.wpengine.com/faq/

https://help.github.com/

http://git-scm.com/docs/git-merge

More Related Content

What's hot

Intro to Git for Drupal 7
Intro to Git for Drupal 7Intro to Git for Drupal 7
Intro to Git for Drupal 7Chris Caple
 
Teaching a Designer to Use GitHub
Teaching a Designer to Use GitHubTeaching a Designer to Use GitHub
Teaching a Designer to Use GitHubLiam Dempsey
 
Puppet at GitHub
Puppet at GitHubPuppet at GitHub
Puppet at GitHubPuppet
 
Why you can't ignore GitLab
Why you can't ignore GitLabWhy you can't ignore GitLab
Why you can't ignore GitLabPivorak MeetUp
 
GitFlow, SourceTree and GitLab
GitFlow, SourceTree and GitLabGitFlow, SourceTree and GitLab
GitFlow, SourceTree and GitLabShinu Suresh
 
Save Time and Money with Automation
Save Time and Money with AutomationSave Time and Money with Automation
Save Time and Money with AutomationChris Jean
 
How we scaled git lab for a 30k employee company
How we scaled git lab for a 30k employee companyHow we scaled git lab for a 30k employee company
How we scaled git lab for a 30k employee companyMinqi Pan
 
Git Started With Git
Git Started With GitGit Started With Git
Git Started With GitNick Quaranto
 
FOSDEM 2017: GitLab CI
FOSDEM 2017:  GitLab CIFOSDEM 2017:  GitLab CI
FOSDEM 2017: GitLab CIOlinData
 

What's hot (19)

Intro to Git for Drupal 7
Intro to Git for Drupal 7Intro to Git for Drupal 7
Intro to Git for Drupal 7
 
Teaching a Designer to Use GitHub
Teaching a Designer to Use GitHubTeaching a Designer to Use GitHub
Teaching a Designer to Use GitHub
 
Git best practices workshop
Git best practices workshopGit best practices workshop
Git best practices workshop
 
Puppet at GitHub
Puppet at GitHubPuppet at GitHub
Puppet at GitHub
 
沒有 GUI 的 Git
沒有 GUI 的 Git沒有 GUI 的 Git
沒有 GUI 的 Git
 
Why you can't ignore GitLab
Why you can't ignore GitLabWhy you can't ignore GitLab
Why you can't ignore GitLab
 
Git best practices 2016
Git best practices 2016Git best practices 2016
Git best practices 2016
 
Introducing Wordpress Multitenancy
Introducing Wordpress MultitenancyIntroducing Wordpress Multitenancy
Introducing Wordpress Multitenancy
 
GitFlow, SourceTree and GitLab
GitFlow, SourceTree and GitLabGitFlow, SourceTree and GitLab
GitFlow, SourceTree and GitLab
 
Save Time and Money with Automation
Save Time and Money with AutomationSave Time and Money with Automation
Save Time and Money with Automation
 
Jenkins with Heroku
Jenkins with HerokuJenkins with Heroku
Jenkins with Heroku
 
ConcourseCi Dockerimage
ConcourseCi DockerimageConcourseCi Dockerimage
ConcourseCi Dockerimage
 
How we scaled git lab for a 30k employee company
How we scaled git lab for a 30k employee companyHow we scaled git lab for a 30k employee company
How we scaled git lab for a 30k employee company
 
Git Started With Git
Git Started With GitGit Started With Git
Git Started With Git
 
GitHub Presentation
GitHub PresentationGitHub Presentation
GitHub Presentation
 
Juc boston2014.pptx
Juc boston2014.pptxJuc boston2014.pptx
Juc boston2014.pptx
 
FOSDEM 2017: GitLab CI
FOSDEM 2017:  GitLab CIFOSDEM 2017:  GitLab CI
FOSDEM 2017: GitLab CI
 
Git and github 101
Git and github 101Git and github 101
Git and github 101
 
Blogging for hackers (english)
Blogging for hackers (english)Blogging for hackers (english)
Blogging for hackers (english)
 

Viewers also liked

Git for the Android Developer
Git for the Android DeveloperGit for the Android Developer
Git for the Android DeveloperEffective
 
Essential git for developers
Essential git for developersEssential git for developers
Essential git for developersAidan Casey
 
Git for Android Developers
Git for Android DevelopersGit for Android Developers
Git for Android DevelopersTack Mobile
 
Git For The Android Developer
Git For The Android DeveloperGit For The Android Developer
Git For The Android DeveloperEffective
 
Essential git for developers
Essential git for developersEssential git for developers
Essential git for developersAdam Culp
 
Introduction to Git for developers
Introduction to Git for developersIntroduction to Git for developers
Introduction to Git for developersDmitry Guyvoronsky
 
[Easy] How to use Evernote: Beginner's Guide
[Easy]  How to use Evernote: Beginner's Guide[Easy]  How to use Evernote: Beginner's Guide
[Easy] How to use Evernote: Beginner's GuideAna Uy
 
DATAS Technolody may2016 eng AK
DATAS Technolody may2016 eng AKDATAS Technolody may2016 eng AK
DATAS Technolody may2016 eng AKAlexey Kononenko
 
Git for the Android Developer
Git for the Android DeveloperGit for the Android Developer
Git for the Android DeveloperEffectiveUI
 
Platform freelance ASP .NET / C#
Platform freelance ASP .NET / C# Platform freelance ASP .NET / C#
Platform freelance ASP .NET / C# Saâd Zerhouni
 

Viewers also liked (11)

Git for the Android Developer
Git for the Android DeveloperGit for the Android Developer
Git for the Android Developer
 
Evernote
EvernoteEvernote
Evernote
 
Essential git for developers
Essential git for developersEssential git for developers
Essential git for developers
 
Git for Android Developers
Git for Android DevelopersGit for Android Developers
Git for Android Developers
 
Git For The Android Developer
Git For The Android DeveloperGit For The Android Developer
Git For The Android Developer
 
Essential git for developers
Essential git for developersEssential git for developers
Essential git for developers
 
Introduction to Git for developers
Introduction to Git for developersIntroduction to Git for developers
Introduction to Git for developers
 
[Easy] How to use Evernote: Beginner's Guide
[Easy]  How to use Evernote: Beginner's Guide[Easy]  How to use Evernote: Beginner's Guide
[Easy] How to use Evernote: Beginner's Guide
 
DATAS Technolody may2016 eng AK
DATAS Technolody may2016 eng AKDATAS Technolody may2016 eng AK
DATAS Technolody may2016 eng AK
 
Git for the Android Developer
Git for the Android DeveloperGit for the Android Developer
Git for the Android Developer
 
Platform freelance ASP .NET / C#
Platform freelance ASP .NET / C# Platform freelance ASP .NET / C#
Platform freelance ASP .NET / C#
 

Similar to .Git for WordPress Developers

Git Distributed Version Control System
Git   Distributed Version Control SystemGit   Distributed Version Control System
Git Distributed Version Control SystemVictor Wong
 
Git installation and configuration
Git installation and configurationGit installation and configuration
Git installation and configurationKishor Kumar
 
Collaborative development with git
Collaborative development with gitCollaborative development with git
Collaborative development with gitJoseluis Laso
 
Open up your platform with Open Source and GitHub
Open up your platform with Open Source and GitHubOpen up your platform with Open Source and GitHub
Open up your platform with Open Source and GitHubScott Graham
 
Git 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using GitGit 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using GitGeoff Hoffman
 
The Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHubThe Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHubBigBlueHat
 
Managing a WordPress Site as a Composer Project by Rahul Bansal @ WordCamp Na...
Managing a WordPress Site as a Composer Project by Rahul Bansal @ WordCamp Na...Managing a WordPress Site as a Composer Project by Rahul Bansal @ WordCamp Na...
Managing a WordPress Site as a Composer Project by Rahul Bansal @ WordCamp Na...rtCamp
 
Version Control ThinkVitamin
Version Control ThinkVitaminVersion Control ThinkVitamin
Version Control ThinkVitaminAlex Hillman
 
Dev, Staging & Production Workflow with Gitify (at MODXpo 2015 in Munich)
Dev, Staging & Production Workflow with Gitify (at MODXpo 2015 in Munich)Dev, Staging & Production Workflow with Gitify (at MODXpo 2015 in Munich)
Dev, Staging & Production Workflow with Gitify (at MODXpo 2015 in Munich)Mark Hamstra
 
Git ritesh venture_pact
Git ritesh venture_pactGit ritesh venture_pact
Git ritesh venture_pactriteshtandon23
 
Working in Team using Git in Unity
Working in Team using Git in UnityWorking in Team using Git in Unity
Working in Team using Git in UnityRifauddin Tsalitsy
 
Git Introductive
Git IntroductiveGit Introductive
Git IntroductiveAdham Saad
 
Introduction To Git Workshop
Introduction To Git WorkshopIntroduction To Git Workshop
Introduction To Git Workshopthemystic_ca
 
Untangling fall2017 week2_try2
Untangling fall2017 week2_try2Untangling fall2017 week2_try2
Untangling fall2017 week2_try2Derek Jacoby
 
Untangling fall2017 week2
Untangling fall2017 week2Untangling fall2017 week2
Untangling fall2017 week2Derek Jacoby
 

Similar to .Git for WordPress Developers (20)

Git Distributed Version Control System
Git   Distributed Version Control SystemGit   Distributed Version Control System
Git Distributed Version Control System
 
Git
GitGit
Git
 
Git installation and configuration
Git installation and configurationGit installation and configuration
Git installation and configuration
 
Collaborative development with git
Collaborative development with gitCollaborative development with git
Collaborative development with git
 
Open up your platform with Open Source and GitHub
Open up your platform with Open Source and GitHubOpen up your platform with Open Source and GitHub
Open up your platform with Open Source and GitHub
 
Git 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using GitGit 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using Git
 
Switching to Git
Switching to GitSwitching to Git
Switching to Git
 
The Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHubThe Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHub
 
Managing a WordPress Site as a Composer Project by Rahul Bansal @ WordCamp Na...
Managing a WordPress Site as a Composer Project by Rahul Bansal @ WordCamp Na...Managing a WordPress Site as a Composer Project by Rahul Bansal @ WordCamp Na...
Managing a WordPress Site as a Composer Project by Rahul Bansal @ WordCamp Na...
 
Version Control ThinkVitamin
Version Control ThinkVitaminVersion Control ThinkVitamin
Version Control ThinkVitamin
 
Dev, Staging & Production Workflow with Gitify (at MODXpo 2015 in Munich)
Dev, Staging & Production Workflow with Gitify (at MODXpo 2015 in Munich)Dev, Staging & Production Workflow with Gitify (at MODXpo 2015 in Munich)
Dev, Staging & Production Workflow with Gitify (at MODXpo 2015 in Munich)
 
Wokshop de Git
Wokshop de Git Wokshop de Git
Wokshop de Git
 
Git ritesh venture_pact
Git ritesh venture_pactGit ritesh venture_pact
Git ritesh venture_pact
 
Working in Team using Git in Unity
Working in Team using Git in UnityWorking in Team using Git in Unity
Working in Team using Git in Unity
 
Git Introductive
Git IntroductiveGit Introductive
Git Introductive
 
Git Heaven with Wakanda
Git Heaven with WakandaGit Heaven with Wakanda
Git Heaven with Wakanda
 
Git101
Git101Git101
Git101
 
Introduction To Git Workshop
Introduction To Git WorkshopIntroduction To Git Workshop
Introduction To Git Workshop
 
Untangling fall2017 week2_try2
Untangling fall2017 week2_try2Untangling fall2017 week2_try2
Untangling fall2017 week2_try2
 
Untangling fall2017 week2
Untangling fall2017 week2Untangling fall2017 week2
Untangling fall2017 week2
 

Recently uploaded

Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 

Recently uploaded (20)

Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 

.Git for WordPress Developers

  • 1. .Git Wah? Everyting you wanted to know about .Git but were afraid to ask?
  • 2. Mike Van Winkle • Developer @ WP Engine • Freelance WordPress Developer for 3 years • Second career • Santa Rosa, CA
  • 3. Utopia • I write perfect code. • I upload perfect code to website. • Nobody touches my perfect code without asking me first. • Rinse and Repeat.
  • 4. Reality • Other developers on a project • I do stupid things • Clients sometimes think they can code • Shit happens
  • 5. Version Control • The Problem: How do we maintain stability and continuity in our websites/applications? • The Answer: We save versions.
  • 6. Realistic Workflow http://nvie.com/posts/a-successful-git-branching-model/
  • 7. Realistic Workflow http://nvie.com/posts/a-successful-git-branching-model/
  • 8. Version Control • As much about transitioning a website between states as it is recording changes. • Deployment is quicker and safer. • Changes can be easily “rolled” back. • A google example
  • 9. Subversion or .Git • SVN solves the problem by saving a “revision” with each change committed. Developers then can update code to a specific # • Git Solves the problem by tracking the differences between commits
  • 10. Subversion or .Git • .Git is a “distributed” model with less server overhead and better performance • .Git makes complex workflows much easier to manage • Github.com is a great community of projects and developers sharing code. • Little functions that make life easy (examples later)
  • 11. Getting Started:What you need • A command line tool like iTerm or Putty • RSA Key Pair: https://help.github.com/articles/generating-ssh-keys • Some Code
  • 12. Getting Started: Set up a repo
  • 13. Getting Started: Set up a repo
  • 14. Getting Started:Then What? $ git init [create a .gitignore file ... touch .gitignore ] $ git add . --all OR $ git add wp-content $ git add remote origin git@github.com:mikevanwinkle/My-WP-Site.git git commit -am “initial commit” git push origin master
  • 15. What to ignore? • Large Files • Local Files • custom .htaccess files • custom wp-config.php • WP Core • Folders containing .svn info • Historic Files
  • 16. What to ignore? *~ wp-content/upgrade/* .htaccess ? .svn wp-content/uploads wp-config.php ? .cvs wp-content/blogs.dir/*/* .git pclzip-* .listing log.txt *.bak debug.log *.swp gallery/* cache wp-content/gallery/* .cache wp-content/album/* temp wp-content/plugins/plugins tmp *.tmp imagecache* uploads* *_backup wp-config-sample.php wp-content/w3tc* wp-content/w3-*
  • 17. Deployment On your webhost, you’ll need ssh access or you will need a tool that can deploy via FTP ( Beanstalk ? ) $ git clone git@github.com:mikevanwinkle/My-WP- Site.git $ git pull origin master
  • 18. Development: Example [on your local] $ git branch dev $ git checkout dev [make some changes] $ git commit -am “Making my dev changes” $ git push origin dev [pushes the new branch up] [on production site] $ git pull origin dev $ git checkout dev
  • 19. Development: Example [on your local] $ git branch feature-1 $ git checkout feature-1 [make some changes] $ git commit -am “Making my dev changes” $ git push origin feature-1 [pushes the new branch up] $ git checkout master $ git merge feature-1 $ git commit -am “merge feature-1 with master” $ git push origin master
  • 22. Cool Stuff: Hooks • applypatch-msg • post-commit • post-update • pre-commit • update • commit-msg • post-receive • pre-applypatch • pre-rebase
  • 23. Cool Stuff: Stash • applypatch-msg • post-commit • post-update • pre-commit • update • commit-msg • post-receive • pre-applypatch • pre-rebase
  • 24. Cool Stuff: Stash $ git stash save “Temp 2” $ git stash list $ git stash apply <STASH ID> http://git-scm.com/book/en/Git-Tools-Stashing
  • 25. Cool Stuff: Reset $ git reset --hard HEAD
  • 26. Cool Stuff: Reset $ git reset --hard HEAD
  • 27. Cool Stuff: Archive $ git archive HEAD | gzip > /tmp/ website.tar.gz