Your SlideShare is downloading. ×
0
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
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

Real World Git Workflows - EclipseCon Europe 2013

1,069

Published on

While Git is established in the Open Source world, we're only just seeing the emergence of DVCS in our daily jobs. How can DVCS enable us to collaborate in a traditional "enterprise" …

While Git is established in the Open Source world, we're only just seeing the emergence of DVCS in our daily jobs. How can DVCS enable us to collaborate in a traditional "enterprise" setting.

Atlassian has fully embraced DVCS and has started to build features into their suite of products to take advantage of this new and exciting paradigm.

The talk will dive deep into the successful git work flows used inside Atlassian. There is no size fit all for this topic and various effective processes can be devised and are in active used at our company.

The talk will also cover tools and techniques used to reduce friction during the development of features and bugfix releases like for example pre/post receive hooks and automatic merges.

Outline:

* Software Development Practices And DVCS
- Branch vs fork (single server/repo, vs forks)
- Code quality (pre-commit hook, pre-checkout hook, pre-receive, see below)
* Awesome Git Workflows Used Internally At Atlassian
- Continuous Delivery Branching model
- Product Releases Branching model
* Streamlining Your Git Process
- merge vs rebase
- Rebase as cleanup
- Meaningful merges
- hooks
. hooks in general
. Post-checkout checks
. pre-commit hooks
. Great Pre-receive and Post-receive hooks
- Automatic merges
* How does CI change when you move to git?

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,069
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
52
Comments
0
Likes
1
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 Workflows
  • 2. Nicola Paolucci Developer Advocate / Git Evangelist I come out nice in pictures, I know :-). durdn.com @durdn
  • 3. You heard has Cheap local branching Full local history 10x the speed of svn Staging area Speed Huge community Feature based workflow prominent in Open Source cryptographic integrity Distributed
  • 4. ground breaking paradigm is ground breaking
  • 5. Workflow building blocks fork cheap branching rebase powerful merging distributed clone
  • 6. Can we do a fast Can we fix a bug for the upcoming 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
  • 7. What we’ll cover:
  • 8. What we’ll cover: 1 Branching models
  • 9. What we’ll cover: 1 Branching models 2 Practices & Decisions
  • 10. What we’ll cover: 1 Branching models 2 Practices & Decisions 3 Tooling & Automation
  • 11. What we’ll cover: 1 Branching models 2 Practices & Decisions 3 Tooling & Automation 4 Continuous Integration
  • 12. Which branching model?
  • 13. 1 Which branching model?
  • 14. Two common Branching Models
  • 15. Two common Branching Models 1 Continuous Delivery
  • 16. Two common Branching Models 1 Continuous Delivery 2 Product Releases
  • 17. for Continuous Delivery
  • 18. 1.1 for Continuous Delivery
  • 19. Time feature staging master/ production
  • 20. staging Time feature master/ production master is in production
  • 21. staging Time feature master/ production master is in production staging is the next version
  • 22. staging Time feature master/ production master is in production staging is the next version new features off staging with branch names like: username/ISSUE-KEY-summary
  • 23. staging Time feature master/ production master is in production PR staging is the next version new features off staging with branch names like: username/ISSUE-KEY-summary
  • 24. staging promoted from staging, can receive hotfixes Time feature master/ production master is in production PR staging is the next version new features off staging with branch names like: username/ISSUE-KEY-summary
  • 25. staging promoted from staging, can receive hotfixes Time feature master/ production master is in production PR staging is the next version new features off staging with branch names like: Hotfix username/ISSUE-KEY-summary
  • 26. staging promoted from staging, can receive hotfixes Time feature master/ production master is in production PR staging is the next version new features off staging with branch names like: Hotfix username/ISSUE-KEY-summary
  • 27. for Product Releases
  • 28. 1.2 for Product Releases
  • 29. 1 One Central Repository
  • 30. master PRJ-123-description Time feature branches 1 One Central Repository 2 One Branch per Feature
  • 31. PRJ-123-bug-description Time bugfix branch master 1 One Central Repository 2 One Branch per Feature 3 One Branch per Bugfix
  • 32. 2.2 PRJ-345-bug-description Time bugfix release branch master
  • 33. master 2.2 PRJ-345-bug-description Time bugfix release branch 4 Release Branches
  • 34. master Long running 2.2 PRJ-345-bug-description Time bugfix release branch 4 Release Branches
  • 35. master Long running 2.2 PRJ-345-bug-description Time bugfix release branch 4 Release Branches 5 master is alpha / RC
  • 36. Automatic merges for the win!
  • 37. release branch release branch 2.1 2.2 PRJ-345-bug-description Time bugfix master
  • 38. Automatic MERGES! release branch release branch 2.1 2.2 PRJ-345-bug-description Time bugfix master
  • 39. Automatic MERGES! release branch release branch 2.1 2.2 PRJ-345-bug-description Time bugfix master
  • 40. Automatic MERGES! release branch release branch 2.1 2.2 PRJ-345-bug-description Time bugfix master
  • 41. Placeholder for changes you DON’T want to merge!
  • 42. release branch release branch 2.1 2.2 2.2.1
  • 43. release branch release branch 2.1 2.2 2.2.1 2.1.4
  • 44. release branch release branch 2.1 2.2 2.2.1 2.1.4 2.1.5-SNAPSHOT
  • 45. release branch release branch 2.1 2.2 2.2.1 2.1.4 2.1.5-SNAPSHOT We don’t want to merge the 2.1.x version!
  • 46. release branch release branch 2.1 2.2 2.2.1 2.1.4 2.1.5-SNAPSHOT What can we do here? We don’t want to merge the 2.1.x version!
  • 47. git merge
  • 48. git merge --strategy= resolve
  • 49. git merge --strategy= recursive
  • 50. git merge --strategy=
  • 51. git merge --strategy= ours
  • 52. stable branch stable branch 2.1 2.2 2.2.1 2.1.4 2.1.5-SNAPSHOT
  • 53. stable branch stable branch 2.1 2.2 2.2.1 2.1.4 2.1.5-SNAPSHOT $> git checkout stable-2.2 $> git merge -s ours stable-2.1
  • 54. stable branch stable branch 2.1 2.2 2.2.1 2.1.4 2.1.5-SNAPSHOT $> git checkout stable-2.2 $> git merge -s ours stable-2.1 merge commit, content discarded
  • 55. Deep breath, it’s really simple
  • 56. The secret sauce The merge protocol
  • 57. 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 Continuously Never Less stable than its baseline When code complete Continuously
  • 58. 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 Continuously Never Less stable than its baseline When code complete Continuously
  • 59. 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 Continuously Never When code complete Continuously Release branch Less stable than its baseline
  • 60. 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 Continuously Never When code complete Continuously Release branch Less stable than its baseline
  • 61. 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 Continuously Never When code complete Continuously Release branch Less stable than its baseline
  • 62. 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 Continuously Never When code complete Continuously Release branch Less stable than its baseline
  • 63. 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 Continuously Never When code complete Continuously Release branch Less stable than its baseline Feature branches
  • 64. 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 Continuously Never When code complete Continuously Release branch Less stable than its baseline Feature branches
  • 65. 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 Continuously Never When code complete Continuously Release branch Less stable than its baseline Feature branches
  • 66. 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 Continuously Never When code complete Continuously Release branch Less stable than its baseline Feature branches Credit: Laura Wingerd - The Flow of change
  • 67. The secret sauce The merge protocol Release Branch Master
  • 68. The secret sauce The merge protocol Release Branch Merge continuously Master
  • 69. The secret sauce The merge protocol Release Branch Never Merge merge! continuously Master
  • 70. The secret sauce The merge protocol Release Branch Never Merge merge! continuously Master Backport single changes using git cherry-pick
  • 71. Practices & Decisions
  • 72. turbo boost! 2 Practices & Decisions
  • 73. What is a Pull Request?
  • 74. 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?
  • 75. Merge vs Rebase Does a debate even exist? REBASE MERGE
  • 76. What is a Rebase? feature master
  • 77. What is a Rebase? Merge commit feature master
  • 78. What is a Rebase? Merge commit feature master feature master
  • 79. What is a Rebase? Merge commit feature master feature master
  • 80. What is a Rebase? Merge commit feature master feature master
  • 81. What is a Rebase? Merge commit feature master feature master
  • 82. Merge as team policy
  • 83. Merge as team policy 1 Traceability
  • 84. Merge as team policy 1 Traceability 2 At a cost: readability
  • 85. Merge as team policy 1 Traceability 2 At a cost: readability 3 bisect debugging is harder
  • 86. Merge as team policy with no fast-forwards 1 Traceability 2 At a cost: readability 3 bisect debugging is harder
  • 87. Rebase as team policy [1]
  • 88. Rebase as team policy [1] 1 History flat and clean
  • 89. Rebase as team policy [1] 1 History flat and clean 2 Delicate with Pull Requests
  • 90. Rebase as team policy [1] 1 History flat and clean 2 Delicate with Pull Requests 3 Dangerous for unexperienced
  • 91. Rebase as team policy [2]
  • 92. Rebase as team policy [2] 4 Re-resolve similar conflicts
  • 93. Rebase as team policy [2] 4 Re-resolve similar conflicts 5 Requires often a force push
  • 94. Rebase as team policy [2] 4 Re-resolve similar conflicts 5 Requires often a force push 6 Loses context for feature
  • 95. Rebase as a local cleanup
  • 96. Rebase as a local cleanup 1 Do it
  • 97. Rebase as a local cleanup git rebase --interactive 1 Do it
  • 98. Rebase as a local cleanup git rebase --interactive 1 Do it 2 Do it
  • 99. Rebase as a local cleanup git rebase --interactive 1 Do it 2 Do it 3 Do it!!!!!!
  • 100. Recommendation?
  • 101. Recommendation? 1 If team unfamiliar, don’t rebase
  • 102. Recommendation? 1 If team unfamiliar, don’t rebase 2 Encourage rebase as cleanup and proper ecology
  • 103. Recommendation? 1 If team unfamiliar, don’t rebase 2 Encourage rebase as cleanup and proper ecology 3 Choose clean or traceable
  • 104. Recommendation?
  • 105. Recommendation? 4 Don’t fear the Merge! Use it!
  • 106. Recommendation? Explicit merges into the mainline 4 Don’t fear the Merge! Use it!
  • 107. Recommendation? Explicit merges into the mainline 4 Don’t fear the Merge! Use it! git log --first-parent
  • 108. Recommendation? Explicit merges into the mainline 4 Don’t fear the Merge! Use it! git log --first-parent 5 May rebase feature branches
  • 109. Recommendation? Explicit merges into the mainline 4 Don’t fear the Merge! Use it! git log --first-parent 5 May rebase feature branches To update the feature branch
  • 110. Recommendation? Explicit merges into the mainline 4 Don’t fear the Merge! Use it! git log --first-parent After review! 5 May rebase feature branches To update the feature branch
  • 111. Recommendation? Explicit merges into the mainline 4 Don’t fear the Merge! Use it! git log --first-parent After review! 5 May rebase feature branches To update the feature branch 6 Work with the tool!
  • 112. Recommendation? Explicit merges into the mainline 4 Don’t fear the Merge! Use it! git log --first-parent After review! 5 May rebase feature branches To update the feature branch 6 Work with the tool! Trying to strive for a linearized history is less useful than you think
  • 113. Single Repository vs Remote Forks
  • 114. With Forks Every one has their remote repository
  • 115. With Forks Every one has their remote repository Full remote copy, each has one Integrator, Gatekeeper, Tech Lead, etc.
  • 116. Pros of a Single Repo
  • 117. Pros of a Single Repo 1 Complete visibility
  • 118. Pros of a Single Repo All feature branches available 1 Complete visibility
  • 119. Pros of a Single Repo All feature branches available 1 Complete visibility 2 No per Dev remotes required
  • 120. Pros of a Single Repo All feature branches available 1 Complete visibility 2 No per Dev remotes required 3 KISS
  • 121. Forks Are Great too BTW
  • 122. FORKING IN THE ENTERPRISE
  • 123. FORKING IN 5 Reasons for... ENTERPRISE
  • 124. FORKING IN ENTERPRISE REASON 1 Great for customizing libraries
  • 125. FORKING IN ENTERPRISE REASON 1 Great for customizing libraries and still get bug fixes
  • 126. FORKING IN ENTERPRISE REASON 2 Great for innovation spikes
  • 127. FORKING IN ENTERPRISE REASON 2 Great for innovation spikes and maybe add it later
  • 128. FORKING IN ENTERPRISE REASON 3 Protecting your components
  • 129. FORKING IN but still be open for changes REASON 3 Protecting your components ENTERPRISE
  • 130. FORKING IN ENTERPRISE REASON 4 Reduce the noise
  • 131. FORKING IN ENTERPRISE REASON 4 Reduce the noise and keep the overview for huge projects
  • 132. FORKING IN ENTERPRISE REASON 5 Interaction with Contractors & Interns
  • 133. FORKING IN ENTERPRISE REASON 5 Interaction with Contractors & Interns protect your sources
  • 134. Tooling & Automation
  • 135. 3 Tooling & Automation
  • 136. Hooks
  • 137. “ Hooks are little scripts you can place in the `$GIT_DIR/hooks` directory to trigger ” action at certain points. – githooks Documentation
  • 138. Pre Post
  • 139. Local Remote
  • 140. Local pre-/post-applypatch pre-/post-commit Remote pre-receive update pre-rebase post-receive post-checkout post-update post-merge pre-push
  • 141. Code Quality via pre-commit hooks
  • 142. .git/hooks/pre-commit
  • 143. git add -u git commit -m "TEST checkstyle"
  • 144. Starting audit... /Users/user/[...]/com/atlassian/stash/ web/projects/ProjectController.java: 161:12: 'for' is not followed by whitespace. Audit done. Commit aborted.
  • 145. Branch from green builds
  • 146. .git/hooks/post-checkout
  • 147. $ 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.
  • 148. Get it at: bitly.com/green-builds
  • 149. What happens to CI with ?
  • 150. 4 What happens to CI with ?
  • 151. 1 What happens to CI with git?
  • 152. 1 What happens to CI with git? 2 An explosion of branches
  • 153. 1 What happens to CI with git? 2 An explosion of branches 3 Performance degradation of build sys
  • 154. 1 Building everything is expensive
  • 155. 1 Building everything is expensive 2 Automatically build stable and master
  • 156. 1 Building everything is expensive 2 Automatically build stable and master 3 Manually trigger feature branch builds
  • 157. In Conclusion: the recipe
  • 158. Conclusions Collaboration Model Branching Model Practices & Decisions Automation & CI setup
  • 159. Conclusions Collaboration Model Centralized Branching Model Practices & Decisions Automation & CI setup
  • 160. Conclusions Collaboration Model Branching Model Product workflow Centralized Practices & Decisions Automation & CI setup
  • 161. Conclusions Collaboration Model Branching Model Product workflow Centralized Continuous delivery workflow Practices & Decisions Automation & CI setup
  • 162. Conclusions Collaboration Model Branching Model Product workflow Centralized Continuous delivery workflow Practices & Decisions Embrace PR Automation & CI setup
  • 163. Conclusions Collaboration Model Branching Model Product workflow Practices & Decisions Embrace PR Merge vs Centralized Continuous delivery workflow Rebase Automation & CI setup
  • 164. Conclusions Collaboration Model Branching Model Product workflow Practices & Decisions Embrace PR Merge vs Centralized Continuous Rebase delivery workflow Single Repo or Forks Automation & CI setup
  • 165. Conclusions Collaboration Model Branching Model Product workflow Practices & Decisions Embrace PR Merge vs Centralized Continuous Rebase delivery workflow Single Repo or Forks Automation & CI setup Hooks, hooks everywhere
  • 166. Conclusions Collaboration Model Branching Model Product workflow Practices & Decisions Embrace PR Merge vs Centralized Continuous Rebase delivery workflow Single Repo or Forks Automation & CI setup Hooks, hooks everywhere Build automatically, but leave knobs!
  • 167. Nicola Paolucci THANK YOU FOR YOUR ATTENTION! Should I change the pic? ;-) durdn.com @durdn
  • 168. Atlassian Git Repository Management for Enterprise Teams Free Git Code Hosting for Small Teams Free Git Desktop client for Mac or Windows

×