1.85k likes | 2.09k Views
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.
E N D
Facts 500 Developers
Facts 1000+ Nerds
Facts working on 9 products
Teams or in just 3 words We Software
We Software Teams
they know what’s going on! Great idea! Let’s do it! Productivity++ really small team
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
Productivity?? When is it done? Is it profitable? we’re not alone
Devel ping Sftware S cial Challenge is a
happy developers & productive teams Ship software faster & smarter Tools
happy developers & productive teams Ship software faster & smarter
All sorts of teams are on &
All sort of teams
Migrating soon? http://atlassian.com/git/
Be a Happier Developer with
Why does make you happy? Fast & Compact 1 Freedom & Safety 2 Explore & Understand 3 Control and Assemble 4
But Why? Or How?
A lot of the “Why” can be explained at the Conceptual model
Written in C by Linux kernel and filesystem developers
5 minutes dive into internals
“ Git is fundamentally a content-addressable filesystem with a VCS user interface written on top of it ” Pro Git Book, Section: Git Internals
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
$> tree .git/objects .git/objects ├── info └── pack 2 directories
$> tree .git/objects .git/objects ├── e4 │ └── 3a6ac59164adadac854d591001bbb10086f37d ├── info └── pack zlib compressed SHA1 3 directories, 1 file
$> tree .git/objects .git/objects ├── 13 │ └── 1e360ae1a0c08acd18182c6160af6a83e0d22f ├── 31 │ └── 995f2d03aa31ee97ee2e814c9f0b0ffd814316 ├── e4 │ └── 3a6ac59164adadac854d591001bbb10086f37d ├── info └── pack Commit Tree Blob 5 directories, 3 files
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
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.. … … …
$> tree .git/objects .git/objects ├── 13 │ └── 1e360ae1a0c08acd18182c6160af6a83e0d22f ├── 31 │ └── 995f2d03aa31ee97ee2e814c9f0b0ffd814316 ├── c1 │ └── 9e6823e34980033917b6427f3e245ce2102e6e ├── e4 │ └── 3a6ac59164adadac854d591001bbb10086f37d Entirely new BLOB 6 directories, 4 files
$> tree .git/objects .git/objects ├── info │ └── packs └── pack ├── pack-7475314b451a882d77b1535d215def8bad0f4306.idx └── pack-7475314b451a882d77b1535d215def8bad0f4306.pack 2 directories, 3 files
Loose Objects Packfile 1. zlib compressed 2. Delta encoded
Everything is local Except push & pull
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
What is a merge? merges keep the context of the feature’s commits feature Merge commit feature master M master
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'