So Help Me God, You Will Understand Git's Model, Even If It Kills Me

So Help Me God, You Will Understand Git's Model, Even If It Kills Me

1945ab4cdb87eaf5a5c906fa884c29f1?s=128

Scott Robinson

April 25, 2012
Tweet

Transcript

  1. 2.

    1 2 3 4 6 7 8 9 11 15

    16 10 12 14 5 13 Trunk Branches Merges Tags Discontinued development branch
  2. 3.
  3. 4.
  4. 11.

    Trees $ git ls-tree eebc19d60284277eba86620ec828d73d0cdf822a 100644 blob 1377554ebea6f98a2c748183bc5a96852af12ac2 .gitignore 100644

    blob ac1bfdc65a699792310498fc0ba003e61eddf1d0 bad.lua 100644 blob b2f5ce962808f4edd04336eb803b6445b843e052 boom.lua 100644 blob 6b1c0b8946e40ff393f73d80a885fdd39fba93dd bullet.lua 100644 blob 268a04ca259b566c7340d8ba8dab8ce0590e8352 main.lua 100644 blob 67638336f18030013b0bcc7533987a6ba892ba46 rail.lua 040000 tree 415ee50b6cf27815df2750de33b0eac1df8ad814 resources 100644 blob c1a79a49a98c0b3868e33270465121cf40dc622e ship.lua 100644 blob d77c7f1d5fecfc6c998e2eec628495075ba27ec1 wave.lua
  5. 13.

    Commit $ git cat-file -p eea6bd6db666365b33496b9fc4c2d55c7af8fdcd tree eebc19d60284277eba86620ec828d73d0cdf822a parent bfe1204bb4d8eaa00b7a20c47e6e421e9be25322

    author Sam Gibson <sam@ifdown.net> 1327417487 +0530 committer Sam Gibson <sam@ifdown.net> 1327417487 +0530 Bounds -> Box
  6. 21.

    Yes, that was a warm up $ find ./.git .

    ./.git ./.git/config ./.git/description ./.git/HEAD ./.git/hooks ... ./.git/info/exclude ./.git/objects/info ./.git/objects/pack ./.git/refs/heads ./.git/refs/tags
  7. 22.

    What Happens? $ touch xyzzy $ git add xyzzy $

    git status # On branch master # # Initial commit # # Changes to be committed: # (use "git rm --cached <file>..." to unstage) # # new file: xyzzy #
  8. 24.

    You Delete A File And Then Commit It? $ rm

    xyzzy $ git commit -m 'What happens?'
  9. 25.

    You Can’t Explain That! $ ls $ git status #

    On branch master # Changes not staged for commit: # (use "git add/rm <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) # # deleted: xyzzy # no changes added to commit (use "git add" and/or "git commit -a") $ git checkout -- xyzzy $ ls xyzzy
  10. 30.

    Rebase • "your" commit • "their" base commit • their

    most recent ancestor • Replays each of “your” differences upon “their” base
  11. 32.