Se ha denunciado esta presentación.
Utilizamos tu perfil de LinkedIn y tus datos de actividad para personalizar los anuncios y mostrarte publicidad más relevante. Puedes cambiar tus preferencias de publicidad en cualquier momento.

Using Git with WordPress - Presented by Nigel Rodgers.

748 visualizaciones

Publicado el

I will give a brief introduction to the Git Version Control System (VCS). Short demonstration of using git with WordPress. The demo will be for coding a theme or child theme. Then advantages and disadvantages of using a VCS.

Publicado en: Internet
  • Inicia sesión para ver los comentarios

  • Sé el primero en recomendar esto

Using Git with WordPress - Presented by Nigel Rodgers.

  1. 1. WordPress Development With Git
  2. 2. Imagine You’ve been hired to build a web app Maybe you start with basic WordPress Install
  3. 3. You work on the project for a few days
  4. 4. You Show the client a really great feature but she doesn’t like it so you delete your code
  5. 5. A few days later your client suddenly loves the great feature, but you’ve deleted it.
  6. 6. How do you manage your project files? You may use a naming convention like: Prototype 1 Prototype 2 Added Great Feature Prototype 3 You may add a comment to the end of the file name to remember what edit it contains Deleted Great Feature Great Feature Again
  7. 7. In A project you’ll deal with multiple files with different versions that could go up to the thousands
  8. 8. Collaboration can be challenging
  9. 9. Version Control ○ Version control, revision control or source control ○ any kind of practice that tracks and provides control over changes to source code (Wikipedia) ○ All software projects have some form of version control ○ Version Control Systems usually run as stand alone applications ○ Some examples are CVS, Subversion (SVN), Mercurial and Git
  10. 10. Git (and VCS in general) ●Share code easily ●Track changes ( and undo or redo them easily) ●Collaborate easily ●Clearly communicate what changes have been made ●Improve workflow (easier to plan and execute tasks)
  11. 11. How it works ●Git maintains a repository: A collection of project files with special information such as what changes occurred, a description of each change, and who made the change. ●Git does not automatically track changes, it has to be explicitly told when a version is finished, when that happens it’s called a commit.
  12. 12. The Repository ●Commits are stored as hidden files in the repository so that your project looks like it would without a VCS. ●Git provides a set of tools to manage the repository ●Git is accessed through the console/terminal (there are GUI tools but the terminal is the most powerful method)
  13. 13. Common Commands in Git ●Init - initialize repository ●commit - move changes to the repository ●checkout - Retrieve a version of the project ●branch - A separate version from the main version of a project ●master - The main version ●merge - combine all the changes of two branches into one. ●log - a summary of the commits performed ●status - the current state of the repository showing tracked/untracked files, and changes since last commit
  14. 14. Working with Git in WordPress There are many different workflows for using Git with WordPress, each with its strengths and weaknesses. For demonstration sake I will show how to track the development of a child theme with Git. The demonstration may not follow WordPress best practices. The goal is to demonstrate Git as simply as possible.
  15. 15. Create child theme folder wc_twentyfourteen
  16. 16. In the console, inside the child theme folder, initialize the git repository
  17. 17. Create functions.php, style.css and screenshot.png in the child theme folder
  18. 18. Git Status
  19. 19. Git add
  20. 20. Git commit
  21. 21. Add footer.php file to the child theme folder and commit
  22. 22. Customized the footer and commit
  23. 23. Git log
  24. 24. Git Checkout Checkout between the master and previous commit and observe how the site changes on reload
  25. 25. Wow! A lot of work for just a footer! ●The exercise shows the basic concept of git, in practice you won’t have to commit every little change. ●The git workflow you use will depend on personal or organisational preference ●As you get used to the commands and use git consistently it will become a powerful tool ●The demo did not even go into the powerful concept of branches
  26. 26. Why Use Git? ●Easier sharing (Github and Bitbucket) ●Better workflow ●Easier colaboration ●Getting a job (Any company with a clue uses come kind of version control.) NB git is not a backup tool
  27. 27. Learn More ●Git offical: www.git-scm.com ●Github: www.gitub.com ●Bitbucket: www.bitbucket.org ●Muzinda hub & teamtreehouse: www.teamtreehouse.com ●Google ●WordPress meetups
  28. 28. VersionPress ●Git is awesome for WordPress except you can’t sync the database ●VersionPress is a plugin that aims to resolve this issue ●VersionPress was meant to be for people who aren’t interested in the technical side of git, however it is still challenging to install and use
  29. 29. What VersionPress can do ●Automatically track any changes on WordPress e.g. a post update, or plugin installed/updated ●Undo any actions like the above mentioned ●Merge two databases. So you can sync your production site with your development site. ●Most of what git can do
  30. 30. More about VersionPress www.versionpress.com
  31. 31. Thank You ●You made it to the end of my boring presentation! ●Harare WordCamp team ●Thanks to the sponsors ●Keep cultivating the culture of sharing! Nigel Rodgers: rodgersnigel@gmail.com Blog: mwanavhu.wordpress.com

×