FTP Commando to Git Hero - WordCamp Denver 2013

777 views

Published on

The basics of using version control using WordPress and Git. Also includes a sprinkling of deployment using Beanstalk.

Published in: Technology
1 Comment
2 Likes
Statistics
Notes
  • I’ve written a little PHP script that heps with deployments, but you can use locally. It si called PHPloy and is tightly-coupled with Git to determine what which files where edited/added/deleted and uploads them accordingly. You put your FTP details in a deploy.ini file and run just a command to deploy:

    phploy

    You can also deploy to multiple servers at once. And if you have multiple servers configured, you can select to deploy to one of them like this:

    phploy --server staging

    There is more that can be done – check it out on Github: https://github.com/banago/PHPloy
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total views
777
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
5
Comments
1
Likes
2
Embeds 0
No embeds

No notes for slide

FTP Commando to Git Hero - WordCamp Denver 2013

  1. 1. FTP Commando to Git Hero WordCamp Denver November 16, 2013
  2. 2. Organize Fort Collins WordPress meetup 3 plugins on the WordPress repository Build themes and plugins
  3. 3. 1. What is version control, and why use it? and why use it?
  4. 4. 2. How to use version control with WordPress with WordPress
  5. 5. 3. Adding deployment to your workflow your workflow
  6. 6. What is version control?
  7. 7. me, pre-version control
  8. 8. Dated Folders
  9. 9. Problem #1 How do you access deleted code?
  10. 10. Problem #2 How do you effectively collaborate?
  11. 11. Problem #3 How do you know what change is in what folder?
  12. 12. Really long, descriptive folder names
  13. 13. Version Control Provides a history of changes made to files in a project
  14. 14. Version Control Provides a history of changes made to files in a project
  15. 15. Repository
  16. 16. Repository
  17. 17. Git A popular vcs created in 2005 by Linus Torvalds, the creator of the Linux kernel
  18. 18. Distributed Everyone has their own copy of the project Don’t need a network connection No central repository
  19. 19. Distributed Version Control System Server repo Computer A repo Computer B repo
  20. 20. That’s all great, but how do I use it?
  21. 21. Fort Collins Lambkins
  22. 22. Interacting with Git
  23. 23. Terminal
  24. 24. Remember keyboarding class?
  25. 25. git-scm.com/downloads
  26. 26. git init
  27. 27. git add <filename>
  28. 28. Staging File 1 File 2 File 3 Repository
  29. 29. git commit -m “Initial commit”
  30. 30. Good Commit Messages 1. Add navigation to header 2. Remove slider from homepage
  31. 31. Bad Commit Messages 1. Fixed that thing that was broken. 2. Edited some code. Now I need a beer.
  32. 32. You are now using version control! QuickTime™ and a GIF decompressor are needed to see this picture.
  33. 33. git log
  34. 34. git status
  35. 35. git commit -a -m “Commit Message”
  36. 36. git log
  37. 37. git status
  38. 38. git add . git commit -m “Add stylesheet”
  39. 39. How often should I commit? Is there a good commit message I could write?
  40. 40. Using Version Control with WordPress with WordPress +
  41. 41. 1. Install a fresh copy of WordPress 2. Initialize a new git repository 3. Create a .gitignore file 4. Add the current files to staging 5. Commit those files to the repository as the first commit
  42. 42. 1. Install a fresh copy of WordPress
  43. 43. 2. Initialize a new git repository git init
  44. 44. 3. Create a .gitignore file
  45. 45. 4. Add current files to staging git add .
  46. 46. 5. Commit staged files to the repository git commit -m “Initial commit”
  47. 47. + !
  48. 48. 1. Make changes to files. 2. Add those changed files to staging. 3. Commit staged files to the repository. 4. Repeat.
  49. 49. Real World Examples
  50. 50. Scenario #1 The Client Changes Their Mind The Client Changes Their Mind
  51. 51. Check the project’s commit history git log
  52. 52. Go back in time git checkout <commit identifier>
  53. 53. Scenario #2 Collaborate with Another Developer Collaborate with Another Developer
  54. 54. Remote Hosting Options
  55. 55. Setup Connection to Remote Repository git remote add origin <path_for_remote> Server repo Computer A repo
  56. 56. Send Repository to Remote Server git push origin master Server repo Computer A repo
  57. 57. Developer Copies Repository Locally git clone <url> Server repo Computer A repo Computer B repo
  58. 58. Developer Connects to Repository git remote add origin <path_for_remote> Server repo Computer A repo Computer B repo
  59. 59. Developer Pushes Up Their Changes git push origin <branch> Server repo Computer A repo Computer B repo
  60. 60. View Commit History
  61. 61. Branches
  62. 62. master branch branch
  63. 63. Why? Stay more organized Easily maintain your “in-progress” work separate from your completed, tested, and stable code Collaborate with others more effectively
  64. 64. master Build features in branches branch merge feature bug fix
  65. 65. Tips Only commit finished work to the master branch Create branches for features and large bug fixes Delete feature branches once merged
  66. 66. Create New Branch git branch <branch_name> git checkout <branch_name> master branch
  67. 67. master Build Cool Feature branch
  68. 68. Merge Completed Feature git checkout master git merge <branch_name>
  69. 69. Merge Completed Feature master branch
  70. 70. Keep Your Repository Clean git branch -d <branch_name> master
  71. 71. Deployment
  72. 72. Push code. Deploy in one click.
  73. 73. Setup Repository
  74. 74. Set Permissions
  75. 75. Create Remote Repository
  76. 76. Create Your Remote git remote add beanstalk <url>
  77. 77. Send Files to Your Remote git push beanstalk master
  78. 78. Create Deployment Environment
  79. 79. Add Server to Environment
  80. 80. Test Connection Settings
  81. 81. Deploy!
  82. 82. Resources Beanstalk Guides - http://guides.beanstalkapp.com Git Book - http://git-scm.com/book Git Immersion - http://gitimmersion.com/ Git Basics - http://teamtreehouse.com/library/git-basics
  83. 83. Questions? @greenhornet79 endocreative.com

×