Your SlideShare is downloading. ×
Git Makes Me Angry Inside
Git Makes Me Angry Inside
Git Makes Me Angry Inside
Git Makes Me Angry Inside
Git Makes Me Angry Inside
Git Makes Me Angry Inside
Git Makes Me Angry Inside
Git Makes Me Angry Inside
Git Makes Me Angry Inside
Git Makes Me Angry Inside
Git Makes Me Angry Inside
Git Makes Me Angry Inside
Git Makes Me Angry Inside
Git Makes Me Angry Inside
Git Makes Me Angry Inside
Git Makes Me Angry Inside
Git Makes Me Angry Inside
Git Makes Me Angry Inside
Git Makes Me Angry Inside
Git Makes Me Angry Inside
Git Makes Me Angry Inside
Git Makes Me Angry Inside
Git Makes Me Angry Inside
Git Makes Me Angry Inside
Git Makes Me Angry Inside
Git Makes Me Angry Inside
Git Makes Me Angry Inside
Git Makes Me Angry Inside
Git Makes Me Angry Inside
Git Makes Me Angry Inside
Git Makes Me Angry Inside
Git Makes Me Angry Inside
Git Makes Me Angry Inside
Git Makes Me Angry Inside
Git Makes Me Angry Inside
Git Makes Me Angry Inside
Git Makes Me Angry Inside
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Git Makes Me Angry Inside

1,759

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,759
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
11
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Git Makes Me Angry Inside Emma Jane Westby Education Development Coordinator Drupalize.Me @emmajanehw http://drupalize.me Slides at: http://tinyurl.com/dcto13-git Saturday, 13 July, 13 Problem: Developers face a steep learning curve when they choose to adopt version control. Solution: There is a version control strategy to suit your workflow, even if you've always thought it was too hard to bother. Is your project folder filled with files like this: page.old.2.bak.php? Does Git make you angry inside? Do you resent that everyone except you regularly visits the magical place referred to as "The Command Line"? Are you afraid of the vagrant who stole your puppet? In this session you will get a gentle introduction to working efficiently as a developer in small teams, or as a solo developer. We'll focus on real world examples you can actually use to make your work faster and more efficient. Yes, this is an introductory session. This is for people who feel shame that they don't know how to "just cd into yer root durrr" and get mad when people say "just diff me a patch" as if it's something as easy as making a mai thai even though you have no rum. No, you don't have to have git installed to attend. You don't even need to know where the command line is on your computer.
  • 2. Why Stick Around • Learn how Git thinks, without being exposed to the command line. • Learn how to structure your work flow to take advantage of Git. • Learn how basic commands are applied to common work flow scenarios. • Q&A / therapy session Saturday, 13 July, 13
  • 3. What’s your role? Saturday, 13 July, 13 You need to start with the people....
  • 4. What are your tasks? download work create snapshot share work Saturday, 13 July, 13 What are the tasks that your team work on? For example: download work, make changes, upload work to a shared space.
  • 5. What’s your workflow? Saturday, 13 July, 13 There are a lot of valid workflows.
  • 6. What’s your branch management strategy? Saturday, 13 July, 13 As your people are working together, they need to have private, and shared spaces to do their work. This is where a branch management strategy gets layered in.
  • 7. How do we make Git do that? Git Shell, cross-platform Saturday, 13 July, 13 We’re not going to talk about the specifics of how to run commands today. But these are a few examples of the GUIs that are available for different platforms. (You don’t *have to be* stuck on the command line if you don’t want to be.) Before we get started: let’s take a second to find out who you are. Why are you here, and how are you currently struggling with version control?
  • 8. Git is 90% process and 10% technology. • Git was written by kernel developers, for kernel developers. Chances are high you’re not a kernel developer. Stop blaming yourself, and start blaming Git for your struggles. • Not all is lost! If you can diagram the problem you are trying to solve; you will be able to find the right Git commands. • Before we start drawing pictures, let’s take a look at some of the concepts version control helps us with. Saturday, 13 July, 13 Out of the box, Git does basically nothing for you. It’s your processes that will allow you to apply the tools you need to make version control work for you. Then go through each of the points listed. Transition: let’s take a look at some of the terms you’ll run into when working with Git to give us a shared language.
  • 9. Version control (sort of) makes automation easier • Backup and restore • Synchronize across multiple platforms • Short-term “undo” to test implications of changes • Long-term “undo” to reverse bugs or regressions • Track changes to see why/how software evolved • Track ownership to give “credit” to change makers • Sandbox code to test changes without affecting other people and systems Saturday, 13 July, 13 There are a lot of valid reasons to use version control. The biggest gain bigger teams will see is in automation of process. But you don’t need to automate things to take advantage of version control. Read through the list of things version control helps with.
  • 10. Terminology: locations • remote repository • trunk or main • head or tip • local repository • client • working copy Saturday, 13 July, 13 There are a lot of terms in version control. Creating a map of where things live can make the documentation a lot easier to deal with. Repo: database of changes to your files. Server: computer storing the repo Client: computer connecting to the repo Working copy: local copy where changes are made Trunk/main: The current, primary source for unchanged code Head: the latest revision in a repository (tip: latest in a branch...HEAD moves, tip doesn’t).
  • 11. Terminology: actions and tasks Saturday, 13 July, 13 With our locations mapped out, let’s take a look at the common tasks or “actions” you can take. Basic actions: adopt / download: clone, merge, fetch, checkout, pull/rebase review: log, status compare: diff HEAD, diff, diff --cached reset: checkout, checkout HEAD, reset --hard (throw away in-between commits), revert (save in-between commits) save: add -u, commit, commit -a distribute: push
  • 12. Set the stage! Before we can set our workflow we need to know who we’re dealing with and what they’re supposed to be doing. Saturday, 13 July, 13 People first. In this next section, we’ll start with the folks on your team (not the software).
  • 13. Who’s on your code team? Write down a list of all of the people on your code team. This list may include: • developers • designers • project managers • clients Saturday, 13 July, 13 Who are the folks on your team? Designer? Developer? Site builder?
  • 14. Where do you fit in? Maybe you do everything. Maybe you only do some things. Write a list of all the tasks you are actually responsible for. This might include: • Writing code. • Reviewing code. • Pushing tested code to the server. • Fixing broken code. Saturday, 13 July, 13 Slide is “as advertised”.
  • 15. What are your tools and restraints? Often there are other things we need to fit into our workflow. Create a third list of any tools and restraints you are aware of. This list might include: • Version control software (we’ll always assume Git) • Code hosting system (Bitbucket, GitHub, self-hosted) • Server ecosystem (dev / staging / live) • Code editors & integrated developer environments (vim, Dreamweaver, Sublime, PHPstorm) • Automated testing systems or review “gates” Saturday, 13 July, 13 Slide is “as advertised”.
  • 16. What’s your workflow? With the team members identified, it’s time to sketch out how these people (ideally) work together. Saturday, 13 July, 13 Now that we know the people, let’s talk about how they work together. There are lots of valid ways of working together, let’s take a look at a few of them.
  • 17. Solo developer workflow Saturday, 13 July, 13 Solo dev workflow: create project, add files, do work, upload files
  • 18. Partner workflow with no central server Saturday, 13 July, 13 James starts a grocery list; Emma already had a grocery list started so she asks to see James’s list. She adds her items to James’s list and hands it back.
  • 19. Centralized workflow with no local commits Saturday, 13 July, 13 the “old” style of version control has a single place where all work is checked into. Every time work is saved, it’s uploaded to the shared space. You can implement this workflow with distributed version control too, but you wouldn’t want to.
  • 20. Decentralized with human gatekeeper Saturday, 13 July, 13 This is pretty typical: it’s a decentralized workflow. The developers pull/clone. Do their work locally and then ask their “gatekeeper” to check their work and merge it into the central repo. Once the central repo has the changes, the devs grab a fresh copy and continue their work.
  • 21. Decentralized with automated gatekeeper Saturday, 13 July, 13 The decentralized with automated gatekeeper is almost the same, except it’s a computer making the decision on whether or not code should be accepted. This is fine for quantitative reviews, but shouldn’t be used for qualitative reviews...unless there are pre-merge peer reviews also happening.
  • 22. Sketch out your workflow • Identify the roles on your team. • Identify the relationships between the team members. • Draw arrows to show how code flows between team members. Saturday, 13 July, 13 Slide is “as advertised”.
  • 23. How will you manage your branches? With the workflow described, it’s time to look at how the code will be segregated into different branches. Saturday, 13 July, 13 This is where the fun starts! Managing branches in a distributed workflow.
  • 24. Popular strategies • http://nvie.com/posts/a- successful-git-branching-model • http://scottchacon.com/ 2011/08/31/github-flow.html Saturday, 13 July, 13
  • 25. Work flow and branch management Saturday, 13 July, 13
  • 26. Work flow and branch management Saturday, 13 July, 13
  • 27. Work flow and branch management peer review Saturday, 13 July, 13
  • 28. Work flow and branch management peer review public / live server Saturday, 13 July, 13
  • 29. Work flow and branch management peer review public / live server Saturday, 13 July, 13
  • 30. Work flow and branch management peer review public / live server dev / testing server Saturday, 13 July, 13
  • 31. Work flow and branch management peer review public / live server dev / testing server master master master Saturday, 13 July, 13
  • 32. Work flow and branch management peer review public / live server dev / testing server master master master dev dev dev Saturday, 13 July, 13
  • 33. Work flow and branch management feature feature hotfix featur peer review public / live server dev / testing server master master master dev dev dev Saturday, 13 July, 13
  • 34. Work flow and branch management feature feature hotfix featur peer review public / live server dev / testing server master master master dev dev dev Saturday, 13 July, 13
  • 35. Sketch out your branch management strategy • Identify the roles on your team. • Identify the relationships between the team members. • Draw arrows to show how code flows between team members. • Time: 10 minutes Saturday, 13 July, 13
  • 36. Q&A + Git Therapy Session Saturday, 13 July, 13
  • 37. You can make Git do what you want... now that you know what you want. @emmajanehw http://drupalize.me Slides: http://lb.com/dcto13-git How to git: http://lb.cm/howto-git-videos Saturday, 13 July, 13

×