Your SlideShare is downloading. ×
0
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
JAZOON'13 - Stefan Saasen - Real World Git Workflows
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

JAZOON'13 - Stefan Saasen - Real World Git Workflows

1,182

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,182
On Slideshare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
33
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. Real World Stefan Saasen Workflows
  • 2. TODO Show of hands Picture with hands/lighter/concert
  • 3. git
  • 4. Subversion
  • 5. NO VCS AT ALL? you must love pain
  • 6. Stefan Saasen Atlassian Stash Development Lead I come out nice in pictures, I know :-). @stefansaasen
  • 7. You heard has Cheap local branching Full local history Staging area Speed Much faster than svn Huge community prominent in Open Source cryptographic integrity Superior Merging Distributed
  • 8. ground breaking paradigm is ground breaking
  • 9. Workflow building blocks fork cheap branching rebase powerful merging distributed efficient clone
  • 10. Can we do a fast Can we fix a bug for a specific RELEASE HOTFIXrelease? for the current ? Can we BUILD the current code ? Is the code for that FEATURE complete? Has everybody REVIEWED ? the code for this feature
  • 11. DIFFERENT PEOPLE PRODUCTS CULTURES
  • 12. DIFFERENT PEOPLE PRODUCTS CULTURES
  • 13. DIFFERENT PEOPLE PRODUCTS CULTURES Stash, Bitbucket, JIRA
  • 14. DIFFERENT WORKFLOWS DIFFERENT PEOPLE PRODUCTS CULTURES
  • 15. We’ll cover: 1 Collaboration model 2 Branching model 3 Practices & Decisions 4 Tooling & Automation
  • 16. Easy, right? 1 Which collaboration model?
  • 17. I do my thing here’s mine, who tells john? I do my thing, too ANARCHY look ma, a goat! Fully decentralized Anarchy
  • 18. He is cool Gatekeeper Blessed repository with Gatekeeper To have your work accepted, talk to him
  • 19. Dictator long live the King! Lieutenants guard the King and Lieutenants Blessed repository
  • 20. Centralised Shared common repository we share “everything”
  • 21. More on Collaboration models atlassian.com/git
  • 22. + Enterprise = Centralized
  • 23. Metrics Issues Builds They know where the code needs to go! Deployments
  • 24. 2 Which branching model?
  • 25. Two common Branching Models 1 Continuous Delivery 2 Product Releases
  • 26. 2.2 for Continuous Delivery
  • 27. Time feature staging master/ production promoted from staging, can receive hotfixes master is in production PR staging is the next version new features off staging Hotfix with branch names like: username/ISSUE-KEY-summary
  • 28. “ Significant branches map to a concept in the outside world. It may be a past release, an environment or a role. Those branches are long-running and stable whereas feature branches are ” short lived and volatile. Me, just making this up.
  • 29. 2.1 for Product Releases
  • 30. PRJ-123-description PRJ-123-bug-description Time feature bugfix branch branches master 1 Central Repository Short lived 2 One Branch per Feature 3 One Branch per Bugfix
  • 31. master Long running 2.2 PRJ-345-bug-description Time bugfix release branch 4 Release Branches 5 master is alpha / RC
  • 32. Automatic merges for the win!
  • 33. Automatic MERGES! release branch 2.2 2.1 PRJ-345-bug-description Time bugfix release branch master
  • 34. Placeholder for changes you DON’T want to merge!
  • 35. release branch 2.2.1 2.2 2.1 release branch 2.1.4 2.1.5-SNAPSHOT What can we do here? We don’t want to merge the 2.1.x version!
  • 36. git merge --strategy= resolve
  • 37. git merge --strategy= recursive
  • 38. git merge --strategy= ours
  • 39. stable branch 2.2.1 2.2 2.1 stable branch 2.1.4 2.1.5-SNAPSHOT $> git checkout stable-2.2 $> git merge -s ours stable-2.1 merge commit, content discarded
  • 40. Deep breath, it’s really simple
  • 41. The secret sauce The merge protocol
  • 42. The secret sauce The merge protocol When a branch is: Change flows from branch to baseline: Change flows from baseline to branch: More stable than its baseline Continually Never When code complete Continually Release branch Less stable than its baseline Feature branches Credit: Laura Wingerd - The Flow of change
  • 43. The secret sauce The merge protocol Release Branch Never merge! Merge continually Master Backport single changes using git cherry-pick
  • 44. turbo boost! 3 Practices
  • 45. What is a Pull Request?
  • 46. Pull Request I have some code here! Hey I have some code I want to merge here, take a look? Low friction collaboration Can I merge it here?
  • 47. Single Repository vs Remote Forks
  • 48. With Forks Every one has their remote repository Full remote copy, each has one Integrator, Gatekeeper, Tech Lead, etc.
  • 49. Pros of a Single Repo All feature branches available 1 Complete visibility 2 No per Dev remotes required 3 KISS
  • 50. Forks Are Great too BTW
  • 51. FORKING IN THE ENTERPRISE
  • 52. 4 Reasons for... FORKING IN THE ENTERPRISE REASON 1 Great for customizing libraries and still get bug fixes
  • 53. FORKING IN THE ENTERPRISE REASON 2 Great for innovation spikes and maybe add it later
  • 54. FORKING IN THE but still be open for changes REASON 3 Protecting your components ENTERPRISE
  • 55. FORKING IN THE ENTERPRISE REASON 4 Reduce the noise and keep the overview for huge projects
  • 56. 4 Tooling & Automation
  • 57. Hooks
  • 58. “ Hooks are little scripts you can place in the `$GIT_DIR/hooks` directory to trigger ” action at certain points. – githooks Documentation
  • 59. Pre Post
  • 60. Local Remote
  • 61. Local pre-/post-applypatch pre-/post-commit Remote pre-receive update pre-rebase post-receive post-checkout post-update post-merge pre-push
  • 62. Code Quality
  • 63. .git/hooks/pre-commit
  • 64. git add -u git commit -m "TEST checkstyle"
  • 65. Starting audit... /Users/user/[...]/com/atlassian/stash/ web/projects/ProjectController.java: 161:12: 'for' is not followed by whitespace. Audit done. Commit aborted.
  • 66. Branch from green builds
  • 67. .git/hooks/post-checkout
  • 68. $ git checkout master master is lookin'good! c4f3b4b has 4 green builds.   $ git checkout stable-2.3 DANGER! stable-2.3 is busted. e1324fa has 2 red builds.
  • 69. Get it at: bitly.com/green-builds
  • 70. What happens to CI with git?
  • 71. 1 An explosion of branches 2 Performance degradation of build sys 3 Building everything is expensive
  • 72. 1 Automatically build stable and master 2 Manually trigger feature branch builds
  • 73. In Conclusion: the recipe
  • 74. Conclusions Collaboration Model Branching Model Product workflow Centralized Continuous delivery workflow Merge protocol Adopt Git Practices Embrace PR Single Repo or Forks Automation & CI setup Build automatically, but leave knobs! Hooks, hooks everywhere
  • 75. Thank you for your attention! @stefansaasen ssaasen@atlassian.com www.atlassian.com

×