Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Git: Everybody's Favorite MMO

Paul Hinze
January 31, 2014

Git: Everybody's Favorite MMO

Paul Hinze

January 31, 2014
Tweet

More Decks by Paul Hinze

Other Decks in Technology

Transcript

  1. hamlet/tobe.txt To be, or not to be--that is the question:

    Whether 'tis nobler in the mind to suffer The slings and arrows of outrageous fortune Or to take arms against a sea of troubles And by opposing end them. To die, to sleep-- No more--and by a sleep to say we end The heartache, and the thousand natural shocks That flesh is heir to. 'Tis a consummation Devoutly to be wished. To die, to sleep-- To sleep--perchance to dream: ay, there's the rub, For in that sleep of death what dreams may come
  2. hamlet2/tobe.txt To be, or not to be--that is the question:

    Whether 'tis nobler in the mind to suffer The slings and arrows of outrageous fortune Or to take arms against a sea of troubles And by opposing end them. To die, to sleep-- Y'know what? I'm done with this depressed crap and it's time for me to get some sweet revenge. I'm gonna strap on some guns and bring the pain. Devoutly to be wished. To die, to sleep-- To sleep--perchance to dream: ay, there's the rub, For in that sleep of death what dreams may come
  3. diff -r hamlet/ hamlet2/ diff -r hamlet/tobe.txt hamlet2/tobe.txt 6,8c6,8 <

    No more--and by a sleep to say we end < The heartache, and the thousand natural shocks < That flesh is heir to. 'Tis a consummation --- > Y'know what? I'm done with this depressed crap > and it's time for me to get some sweet revenge. > I'm gonna strap on some guns and bring the pain.
  4. diff -ru hamlet/ hamlet2/ diff -ru hamlet/tobe.txt hamlet2/tobe.txt --- hamlet/tobe.txt

    2014-01-30 11:22:03.000000000 -0700 +++ hamlet2/tobe.txt 2014-01-30 11:26:54.000000000 -0700 @@ -3,9 +3,9 @@ The slings and arrows of outrageous fortune Or to take arms against a sea of troubles And by opposing end them. To die, to sleep-- -No more--and by a sleep to say we end -The heartache, and the thousand natural shocks -That flesh is heir to. 'Tis a consummation +Y'know what? I'm done with this depressed crap +and it's time for me to get some sweet revenge. +I'm gonna strap on some guns and bring the pain. Devoutly to be wished. To die, to sleep-- To sleep--perchance to dream: ay, there's the rub, For in that sleep of death what dreams may come
  5. $ echo "hello" | sha1sum f572d396fae9206628714fb2ce00f72e94f2258f - ! $ echo

    "world" | sha1sum 9591818c07e900db7e1e0bc4b884c945e6a61b24 - ! $ echo "hello" | sha1sum f572d396fae9206628714fb2ce00f72e94f2258f - ! $ cat hamlet2/tobe.txt | sha1sum ee7f88ab16f67924e799f263e9100f960d2ac833 -
  6. $ mkdir hamlet-git $ cd hamlet-git $ git init Initialized

    empty Git repository in /Users/phinze/hamlet-git/.git/
  7. $ cp ../hamlet/tobe.txt $ git add tobe.txt $ git commit

    -m 'add hamlet soliloquy' [master (root-commit) a74d59e] add hamlet soliloquy 1 file changed, 11 insertions(+) create mode 100644 tobe.txt
  8. $ cp ../hamlet2/tobe.txt $ git add tobe.txt $ git commit

    -m 'make soliloquy more awesome' [master 4ff7cef] make soliloquy more awesome 1 file changed, 3 insertions(+), 3 deletions(-)
  9. commit 4ff7cefe501b56beb05d682c5300decedfdc9b15 tree 64d3d44d9900bb93e6612866785e12cecab8dcb2 parent a74d59e1cfb5751d0c345f43d3ed2490008219b5 author Paul Hinze <[email protected]>

    1391108583 -0700 committer Paul Hinze <[email protected]> 1391108583 -0700 ! make soliloquy more awesome ! diff --git a/tobe.txt b/tobe.txt index 5fafeb4..db7b7ef 100644 --- a/tobe.txt +++ b/tobe.txt @@ -3,9 +3,9 @@ Whether 'tis nobler in the mind to suffer The slings and arrows of outrageous fortune Or to take arms against a sea of troubles And by opposing end them. To die, to sleep-- -No more--and by a sleep to say we end -The heartache, and the thousand natural shocks -That flesh is heir to. 'Tis a consummation +Y'know what? I'm done with this depressed crap +and it's time for me to get some sweet revenge. +I'm gonna strap on some guns and bring the pain. Devoutly to be wished. To die, to sleep-- To sleep--perchance to dream: ay, there's the rub, For in that sleep of death what dreams may come
  10. commit 4ff7cefe501b56beb05d682c5300decedfdc9b15 tree 64d3d44d9900bb93e6612866785e12cecab8dcb2 parent a74d59e1cfb5751d0c345f43d3ed2490008219b5 author Paul Hinze <[email protected]>

    1391108583 -0700 committer Paul Hinze <[email protected]> 1391108583 -0700 ! make soliloquy more awesome ! diff --git a/tobe.txt b/tobe.txt index 5fafeb4..db7b7ef 100644 --- a/tobe.txt +++ b/tobe.txt @@ -3,9 +3,9 @@ Whether 'tis nobler in the mind to suffer The slings and arrows of outrageous fortune Or to take arms against a sea of troubles And by opposing end them. To die, to sleep-- -No more--and by a sleep to say we end -The heartache, and the thousand natural shocks -That flesh is heir to. 'Tis a consummation +Y'know what? I'm done with this depressed crap +and it's time for me to get some sweet revenge. +I'm gonna strap on some guns and bring the pain. Devoutly to be wished. To die, to sleep-- To sleep--perchance to dream: ay, there's the rub, For in that sleep of death what dreams may come
  11. commit 4ff7cefe501b56beb05d682c5300decedfdc9b15 tree 64d3d44d9900bb93e6612866785e12cecab8dcb2 parent a74d59e1cfb5751d0c345f43d3ed2490008219b5 author Paul Hinze <[email protected]>

    1391108583 -0700 committer Paul Hinze <[email protected]> 1391108583 -0700 ! make soliloquy more awesome .git/objects/ 64/ d3d44d9900bb93e6612866785e12cecab8dcb2
  12. $ git ls-tree 64d3d44d9900bb93e6612866785e12cecab8dcb2 ! 100644 blob db7b7efa00bc2e2b9d0fcd6a674865d2f49bd3b1 tobe.txt !

    $ git show db7b7efa00bc2e2b9d0fcd6a674865d2f49bd3b1 ! To be, or not to be--that is the question: Whether 'tis nobler in the mind to suffer The slings and arrows of outrageous fortune Or to take arms against a sea of troubles And by opposing end them. To die, to sleep-- Y'know what? I'm done with this depressed crap and it's time for me to get some sweet revenge. I'm gonna strap on some guns and bring the pain. Devoutly to be wished. To die, to sleep-- To sleep--perchance to dream: ay, there's the rub, For in that sleep of death what dreams may come
  13. $ git ls-tree 64d3d44d9900bb93e6612866785e12cecab8dcb2 ! 100644 blob db7b7efa00bc2e2b9d0fcd6a674865d2f49bd3b1 tobe.txt !

    $ git show db7b7efa00bc2e2b9d0fcd6a674865d2f49bd3b1 ! To be, or not to be--that is the question: Whether 'tis nobler in the mind to suffer The slings and arrows of outrageous fortune Or to take arms against a sea of troubles And by opposing end them. To die, to sleep-- Y'know what? I'm done with this depressed crap and it's time for me to get some sweet revenge. I'm gonna strap on some guns and bring the pain. Devoutly to be wished. To die, to sleep-- To sleep--perchance to dream: ay, there's the rub, For in that sleep of death what dreams may come SHA1
  14. $ git ls-tree 64d3d44d9900bb93e6612866785e12cecab8dcb2 ! 100644 blob db7b7efa00bc2e2b9d0fcd6a674865d2f49bd3b1 tobe.txt !

    $ git show db7b7efa00bc2e2b9d0fcd6a674865d2f49bd3b1 ! To be, or not to be--that is the question: Whether 'tis nobler in the mind to suffer The slings and arrows of outrageous fortune Or to take arms against a sea of troubles And by opposing end them. To die, to sleep-- Y'know what? I'm done with this depressed crap and it's time for me to get some sweet revenge. I'm gonna strap on some guns and bring the pain. Devoutly to be wished. To die, to sleep-- To sleep--perchance to dream: ay, there's the rub, For in that sleep of death what dreams may come SHA1
  15. commit a74d59e1cfb5751d0c345f43d3ed2490008219b5 tree 6d9253325317ea12594bb1b4b0d992b7809a947d author Paul Hinze <[email protected]> 1391108552 -0700

    committer Paul Hinze <[email protected]> 1391108552 -0700 ! add hamlet soliloquy commit 4ff7cefe501b56beb05d682c5300decedfdc9b15 tree 64d3d44d9900bb93e6612866785e12cecab8dcb2 parent a74d59e1cfb5751d0c345f43d3ed2490008219b5 author Paul Hinze <[email protected]> 1391108583 -0700 committer Paul Hinze <[email protected]> 1391108583 -0700 ! make soliloquy more awesome
  16. $ tree .git/refs ! git/refs ├── heads │ └── master

    └── tags ! $ cat .git/refs/heads/master ! 4ff7cefe501b56beb05d682c5300decedfdc9b15
  17. $ tree .git/refs ! .git/refs ├── heads │ ├── master

    │ └── romcom └── tags $ git branch romcom !
  18. $ cat .git/HEAD ! a74d59e1cfb5751d0c345f43d3 ed2490008219b5 $ git checkout HEAD^1

    ! You are in a 'detached HEAD' state... ! HEAD is now at a74d59e... add hamlet soliloquy
  19. $ git remote add origin https://github.com/phinze/hamlet-git $ git remote -v

    origin https://github.com/phinze/hamlet-git (fetch) origin https://github.com/phinze/hamlet-git (push)
  20. commit 4ff7cefe501b56beb05d682c5300decedfdc9b15 tree 64d3d44d9900bb93e6612866785e12cecab8dcb2 parent a74d59e1cfb5751d0c345f43d3ed2490008219b5 author Paul Hinze <[email protected]>

    1391108583 -0700 committer Paul Hinze <[email protected]> 1391108583 -0700 ! make soliloquy more awesome ! Change-Id: Iddf56a3d235d17117063284d92a348de0c1db261 .git/hooks/commit-msg
  21. commit 4ff7cefe501b56beb05d682c5300decedfdc9b15 tree 64d3d44d9900bb93e6612866785e12cecab8dcb2 parent a74d59e1cfb5751d0c345f43d3ed2490008219b5 author Paul Hinze <[email protected]>

    1391108583 -0700 committer Paul Hinze <[email protected]> 1391108583 -0700 ! make soliloquy more awesome ! Change-Id: Iddf56a3d235d17117063284d92a348de0c1db261
  22. git push origin HEAD:refs/for/master (1) compare master..HEAD (2) make new

    PS for all unknown commits (3) update PS for any known commits