WordPress Development:  Tracking your code with Version Control Reno-Tahoe WordCamp 2011 Sterling Hamilton | http://sterli...
What is Version Control? Reno-Tahoe WordCamp 2011 Sterling Hamilton | http://sterlinghamilton.com | @sterlo
I can haz apple? Reno-Tahoe WordCamp 2011 Sterling Hamilton | http://sterlinghamilton.com | @sterlo
Apple Version 1 Apple Version 2 Reno-Tahoe WordCamp 2011 Sterling Hamilton | http://sterlinghamilton.com | @sterlo
v13 v12 v14 v15 v16 v17 v18 v19 v20 Reno-Tahoe WordCamp 2011 Sterling Hamilton | http://sterlinghamilton.com | @sterlo
<ul><ul><li>Where  do we keep track of it all? </li></ul></ul><ul><ul><li>What  if we want to go back to a previous versio...
Reno-Tahoe WordCamp 2011 Sterling Hamilton | http://sterlinghamilton.com | @sterlo
In a nutshell...here's the magic: Reno-Tahoe WordCamp 2011 Sterling Hamilton | http://sterlinghamilton.com | @sterlo
? Reno-Tahoe WordCamp 2011 Sterling Hamilton | http://sterlinghamilton.com | @sterlo
Today 2 Weeks Ago Reno-Tahoe WordCamp 2011 Sterling Hamilton | http://sterlinghamilton.com | @sterlo
With the right tool, you can do AWESOME things. <ul><ul><li>Incremental changes? No problem ! </li></ul></ul><ul><ul><li>R...
How can we apply these this newly acquired swag to WordPress? Reno-Tahoe WordCamp 2011 Sterling Hamilton | http://sterling...
Reno-Tahoe WordCamp 2011 Sterling Hamilton | http://sterlinghamilton.com | @sterlo
&quot;Enterprise-class centralized version control for the masses&quot; Apache Centralized version control systems  are de...
Distributed version control systems  are designed with the intent that one repository is as good as any other, and that me...
We don't need to use that! Reno-Tahoe WordCamp 2011 Sterling Hamilton | http://sterlinghamilton.com | @sterlo
Wait...WordPress uses Subversion...why are we talking about GIT? Each solve their own problem! Subversion is fine for deve...
Using Subversion with WordPress Get the code! > svn co http://core.svn.wordpress.org/trunk/ Make changes! Then when you're...
Awesome! I can fix bugs! Add features! Solve world hunger! You bet you can! But...there's some things you should know. Mos...
Reno-Tahoe WordCamp 2011 Sterling Hamilton | http://sterlinghamilton.com | @sterlo
But wait! With  GIT  you can get all of the WordPress code! Make changes to it with equality. You can then make changes......
Using GIT with WordPress Get the code! People have mirrored the Subversion code onto GitHub! > git clone git://github.com/...
How this can benefit you directly. <ul><ul><li>WordPress core update comes out: For some reason your site breaks. </li></u...
How this can benefit you directly. <ul><ul><li>A theme is updated and it's no longer standards compliant. </li></ul></ul><...
Reno-Tahoe WordCamp 2011 Sterling Hamilton | http://sterlinghamilton.com | @sterlo
Upcoming SlideShare
Loading in …5
×

WordPress Development: Tracking Your Code With Version Control

2,957 views
2,917 views

Published on

Slides from the 2011 Reno-Tahoe WordCamp covering why developers should be using some kind of Version Control System and what models are currently being used in the industry.

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,957
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
12
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

WordPress Development: Tracking Your Code With Version Control

  1. 1. WordPress Development: Tracking your code with Version Control Reno-Tahoe WordCamp 2011 Sterling Hamilton | http://sterlinghamilton.com | @sterlo
  2. 2. What is Version Control? Reno-Tahoe WordCamp 2011 Sterling Hamilton | http://sterlinghamilton.com | @sterlo
  3. 3. I can haz apple? Reno-Tahoe WordCamp 2011 Sterling Hamilton | http://sterlinghamilton.com | @sterlo
  4. 4. Apple Version 1 Apple Version 2 Reno-Tahoe WordCamp 2011 Sterling Hamilton | http://sterlinghamilton.com | @sterlo
  5. 5. v13 v12 v14 v15 v16 v17 v18 v19 v20 Reno-Tahoe WordCamp 2011 Sterling Hamilton | http://sterlinghamilton.com | @sterlo
  6. 6. <ul><ul><li>Where do we keep track of it all? </li></ul></ul><ul><ul><li>What if we want to go back to a previous version because there's a worm in the apple?! </li></ul></ul><ul><ul><li>Who put the worm in there and Why ? </li></ul></ul>Reno-Tahoe WordCamp 2011 Sterling Hamilton | http://sterlinghamilton.com | @sterlo
  7. 7. Reno-Tahoe WordCamp 2011 Sterling Hamilton | http://sterlinghamilton.com | @sterlo
  8. 8. In a nutshell...here's the magic: Reno-Tahoe WordCamp 2011 Sterling Hamilton | http://sterlinghamilton.com | @sterlo
  9. 9. ? Reno-Tahoe WordCamp 2011 Sterling Hamilton | http://sterlinghamilton.com | @sterlo
  10. 10. Today 2 Weeks Ago Reno-Tahoe WordCamp 2011 Sterling Hamilton | http://sterlinghamilton.com | @sterlo
  11. 11. With the right tool, you can do AWESOME things. <ul><ul><li>Incremental changes? No problem ! </li></ul></ul><ul><ul><li>Revert to previous versions. DONE . </li></ul></ul><ul><li>Track the reasons for changes as well as the owner of the changes. </li></ul><ul><li>It allows for easier code review and maintenance! </li></ul><ul><li>Cool huh? </li></ul>Reno-Tahoe WordCamp 2011 Sterling Hamilton | http://sterlinghamilton.com | @sterlo
  12. 12. How can we apply these this newly acquired swag to WordPress? Reno-Tahoe WordCamp 2011 Sterling Hamilton | http://sterlinghamilton.com | @sterlo
  13. 13. Reno-Tahoe WordCamp 2011 Sterling Hamilton | http://sterlinghamilton.com | @sterlo
  14. 14. &quot;Enterprise-class centralized version control for the masses&quot; Apache Centralized version control systems are designed with the intent that there is One True Source that is Blessed , and therefore Good. All developers work (checkout) from that source, and then add (commit) their changes, which then become similarly Blessed . The only real difference between the tools current available is in the workflow, performance, and integration that each tool offers. Reno-Tahoe WordCamp 2011 Sterling Hamilton | http://sterlinghamilton.com | @sterlo
  15. 15. Distributed version control systems are designed with the intent that one repository is as good as any other, and that merges from one repository to another are just another form of communication. Any semantic value as to which repository should be trusted is imposed from the outside by process, not by the tool itself. Reno-Tahoe WordCamp 2011 Sterling Hamilton | http://sterlinghamilton.com | @sterlo
  16. 16. We don't need to use that! Reno-Tahoe WordCamp 2011 Sterling Hamilton | http://sterlinghamilton.com | @sterlo
  17. 17. Wait...WordPress uses Subversion...why are we talking about GIT? Each solve their own problem! Subversion is fine for developing with WordPress! Using GIT is also a great idea! They each offer their own solutions to problems! Depending on your project, one might work for you better! Git is not better than Subversion.   It is not worse.   It's different. Reno-Tahoe WordCamp 2011 Sterling Hamilton | http://sterlinghamilton.com | @sterlo
  18. 18. Using Subversion with WordPress Get the code! > svn co http://core.svn.wordpress.org/trunk/ Make changes! Then when you're done you can see what you changed: > svn diff   Turn your changes into a patch! > svn diff > my-patch.txt Always check to see if changes have been made with: > svn status   Add your changes to the repository: > svn commit   Get the latest changes from the repository : > svn update  Reno-Tahoe WordCamp 2011 Sterling Hamilton | http://sterlinghamilton.com | @sterlo
  19. 19. Awesome! I can fix bugs! Add features! Solve world hunger! You bet you can! But...there's some things you should know. Most of you will not have authorization to make changes to the WordPress core. It's a CVS and only certain people can &quot;bless&quot; code. You have to create a patch , then send it to a developer capable of blessing the code, then they have to apply it. The same procedure has to be followed if you're going to share your code with someone else. Inherited Workflow Reno-Tahoe WordCamp 2011 Sterling Hamilton | http://sterlinghamilton.com | @sterlo
  20. 20. Reno-Tahoe WordCamp 2011 Sterling Hamilton | http://sterlinghamilton.com | @sterlo
  21. 21. But wait! With GIT you can get all of the WordPress code! Make changes to it with equality. You can then make changes...commit them...deploy them to your own repository as well as sending them to OTHER developers! Then ... when you're ready - you can open a ticket for WordPress Developers - and attach a patch for them to review. Reno-Tahoe WordCamp 2011 Sterling Hamilton | http://sterlinghamilton.com | @sterlo
  22. 22. Using GIT with WordPress Get the code! People have mirrored the Subversion code onto GitHub! > git clone git://github.com/dxw/wordpress.git Make changes! Then when you're done you can see what you changed: > git diff   Turn your changes into a patch! > git diff > my-patch.txt Always check to see if changes have been made with: > git status   Get the latest changes from the repository : > git pull   Add your changes to the repository: > git add .  > git commit Send your changes to another repository: > git push another-repository master Reno-Tahoe WordCamp 2011 Sterling Hamilton | http://sterlinghamilton.com | @sterlo
  23. 23. How this can benefit you directly. <ul><ul><li>WordPress core update comes out: For some reason your site breaks. </li></ul></ul><ul><li>With version control, as soon as you realize that something has gone wrong you can roll back to the previous version which was stable in one command. </li></ul><ul><ul><li>An update for a plugin comes out and it's no longer compatible with your version of PHP. </li></ul></ul><ul><li>Once again, the problem goes from &quot;whoops&quot; to &quot;whew&quot;. You can roll back the code to any point and time until your environment supports this update. </li></ul>Reno-Tahoe WordCamp 2011 Sterling Hamilton | http://sterlinghamilton.com | @sterlo
  24. 24. How this can benefit you directly. <ul><ul><li>A theme is updated and it's no longer standards compliant. </li></ul></ul><ul><li>You create a patch to fix the issue and send it off to the developer. You've now collaborated on the project, and with the right tool - you can look up all the changes that you've contributed. </li></ul><ul><ul><li>Your server get's hacked and you want to know if they touched any of the code on the server. </li></ul></ul><ul><li>You run one command and see that status of your code to make sure that it hasn't been tampered with. </li></ul><ul><ul><li>You've found a security hole in WordPress (core,plugin or theme) and right away you create a patch to get it fixed immediately on your server. </li></ul></ul><ul><li>You can send this fix out to other developers or other installs in a way where they can apply it quickly and efficiently. </li></ul>Reno-Tahoe WordCamp 2011 Sterling Hamilton | http://sterlinghamilton.com | @sterlo
  25. 25. Reno-Tahoe WordCamp 2011 Sterling Hamilton | http://sterlinghamilton.com | @sterlo

×