1 / 184

Getting Git Right

When you get Git right, it can help you write cleaner code, roll out new features faster, and make your entire development team more efficient.

svenpet
Download Presentation

Getting Git Right

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Who knows ?

  2. Facts 500 Developers

  3. Facts 1000+ Nerds

  4. Facts working on 9 products

  5. Teams or in just 3 words We Software

  6. We Software Teams

  7. they know what’s going on! Great idea! Let’s do it! Productivity++ really small team

  8. I have no time for this! Let’s do it! Why? Great! Productivity? Have you talked to QA? Who will do it? Is it done? team is growing

  9. Productivity?? When is it done? Is it profitable? we’re not alone

  10. Devel ping Sftware S cial Challenge is a

  11. happy developers & productive teams Ship software faster & smarter Tools

  12. happy developers & productive teams Ship software faster & smarter

  13. All sorts of teams are on &

  14. All sort of teams

  15. Migrating soon? http://atlassian.com/git/

  16. is just a tool!

  17. Be a Happier Developer with

  18. Time machine without paradoxes?

  19. Why does make you happy? Fast & Compact 1 Freedom & Safety 2 Explore & Understand 3 Control and Assemble 4

  20. But Why? Or How?

  21. A lot of the “Why” can be explained at the Conceptual model

  22. Written in C by Linux kernel and filesystem developers

  23. 5 minutes dive into internals

  24. Git is fundamentally a content-addressable filesystem with a VCS user interface written on top of it ” Pro Git Book, Section: Git Internals

  25. data model 5b1d3.. blob size content 98ca9.. 92ec2.. 911e7.. commit size tree size blob size tree author committer parent 92ec2.. blob 5b1d3.. blob 911e7.. blob content README LICENSE test.rb cba0a.. r34ti.. cba0a.. blob size content

  26. $> tree .git/objects .git/objects ├── info └── pack 2 directories

  27. git add some-file.txt

  28. $> tree .git/objects .git/objects ├── e4 │  └── 3a6ac59164adadac854d591001bbb10086f37d ├── info └── pack zlib compressed SHA1 3 directories, 1 file

  29. git commit -m "First commit"

  30. $> tree .git/objects .git/objects ├── 13 │  └── 1e360ae1a0c08acd18182c6160af6a83e0d22f ├── 31 │  └── 995f2d03aa31ee97ee2e814c9f0b0ffd814316 ├── e4 │  └── 3a6ac59164adadac854d591001bbb10086f37d ├── info └── pack Commit Tree Blob 5 directories, 3 files

  31. data model 5b1d3.. blob size content 98ca9.. 92ec2.. 911e7.. commit size tree size blob size tree author committer parent 92ec2.. blob 5b1d3.. blob 911e7.. blob content README LICENSE test.rb cba0a.. r34ti.. cba0a.. blob size content

  32. data model commit commit commit size size size … tree author message: 1st! parent tree author message: Update! parent tree author message: More! parent c4d.. c4d.. c4d.. 8efc8.. bc5e7.. size size size tree tree tree blob blob blob 5b1d3.. 911e7.. READM LICENS test.rb blob blob blob 5b1d3.. 911e7.. READM LICENS test.rb blob blob blob 5b1d3.. 911e7.. READM LICENS test.rb cba0a.. cba0a.. cba0a.. … … …

  33. echo "// Comment" >> some-file.txt

  34. git add some-file.txt

  35. $> tree .git/objects .git/objects ├── 13 │  └── 1e360ae1a0c08acd18182c6160af6a83e0d22f ├── 31 │  └── 995f2d03aa31ee97ee2e814c9f0b0ffd814316 ├── c1 │  └── 9e6823e34980033917b6427f3e245ce2102e6e ├── e4 │  └── 3a6ac59164adadac854d591001bbb10086f37d Entirely new BLOB 6 directories, 4 files

  36. wat?

  37. git gc

  38. $> tree .git/objects .git/objects ├── info │  └── packs └── pack ├── pack-7475314b451a882d77b1535d215def8bad0f4306.idx └── pack-7475314b451a882d77b1535d215def8bad0f4306.pack 2 directories, 3 files

  39. Loose Objects Packfile 1. zlib compressed 2. Delta encoded

  40. Fast and Compact

  41. Everything is local Except push & pull

  42. Read: FAST

  43. But what if my repo is big? Linux Kernel release has 15+ million LOC 1 12,000 non-merge commits 2 446k lines of code added 3 1,339 contributors 4 source lwn.net

  44. Control and Assemble

  45. What is a merge? merges keep the context of the feature’s commits feature Merge commit feature master M master

  46. Anatomy of a merge .git/objects/36/80d8c8fd182f97cb0e75045e2fed5c7b7613ed commit tree f362c42032aff677c1a09c3f070454df5b411239 parent 49a906f5722ad446a131778cea52e3fda331b706 parent bd1174cd0f30fe9be9efdd41dcd56256340f230e author Marcus Bertrand <mbertrand@atlassian.com> 1409002123 -0700 committer Marcus Bertrand <mbertrand@atlassian.com> 1409002123 -0700 Merge branch 'foo/mybranch'

More Related