git going w/ git

of 44 /44
Git Going w/ Git

Upload: heymp

Post on 17-Nov-2014

218 views

Category:

Internet


0 download

DESCRIPTION

Slides from my Git Going w/ Git presentation at Drupaldelphia 2014. www.drupaldelphia.com

TRANSCRIPT

  • 1. Git Going w/ Git

2. Michael Potter@hey__MP 3. So what is Git? 4. Why use versioncontrol? 5. So why Git? 6. Top four reasonsFastPopularDistributedBranching! 7. So how does it workexactly? 8. Basic Model There is a Git repo that lives on a server Developers can checkout the repo independently 9. Whats happening locally? Every dev can fetch or pulldown from the remoterepo Work on the files then addthem to the staging area Commit the staged fileslocally Push the changes to theremote repo 10. So how does it handleworkflow? 11. How about this for workflow? 12. Well get back to thatlater 13. Basic Commands 14. Initialize Repo git init 15. Add files to stage git add 16. Commit to local repo git commit -m 17. Push to the remote repo 18. Branching 19. Branching = Workflow Branching is a tool to build a workflow Master is the only branch you start with You can have as many or as little as you want 20. Basic workflow 21. Average workflow 22. Advanced workflow 23. Git-flow 24. Feature branches Where the code is made Examples of feature branch: Calendar, Twitter Widget, New Article field Feature branch could have multiple branches ofof it (so meta) 25. Develop branch Completed features are tested Multiple features can be tested to see how theyimpact each other Can be linked to a development server, oftennamed integration server 26. Release branches Collection of features that passed testing on thedevelop branch Production ready code ready to be merged intomaster Could be linked to a QA server 27. Hotfix The Oh no branch Branched directly off of master Once fixed, its merged up to master and down todevelop branch 28. Master The projects live code Only for merging! 29. Branching tips Break down your work into different features withtheir own branch Minimize merge conflicts by not editing the samefile simultaneously with other developers 30. Lets talk Drupal! 31. Drupal config Drupal 8 configuration is stored in .yml files Drupal 7 configuration still lives in the database 32. So how are we supposedto commit configurationchanges? 33. Features 34. Features workflow On your dev environment create a new photocontent type w/ three new fields and a galleryview. Create a new feature called mywebsite_photosand export the content type, fields, and view. Commit the new feature to your repo. Deploy the changes to the live site and enable thefeature. 35. Updating a featureLets say a change has been made, a new field hasbeen added to the content type and the view.1. Re-export the feature (Protip: drush fu )2. Deploy the change to the live site3. Revert the feature on the live site(Protip: drush fr ) 36. Whoa, thats cool 37. How many featuresshould I have?Thats up to you! 38. Features methodology #1 News Section Courses Section Events Section Homepage Sitewide Defaults 39. Features methodology #2 Content Types Context Field Bases Media Config Pathauto Rules Site config Taxonomy User Config Views XML Sitemap 40. Critical feature helpers Strongarm (drupal.org/strongarm) Diff (drupal.org/diff) Features Override (drupal.org/features_override) Drush! 41. Demo