The GitHub Panel

download The GitHub Panel

of 415

Transcript of The GitHub Panel

  • 8/14/2019 The GitHub Panel

    1/414

    Smacking Git Aroundby Scott Chacon

  • 8/14/2019 The GitHub Panel

    2/414

    Me

  • 8/14/2019 The GitHub Panel

    3/414

    Scott Chacon

  • 8/14/2019 The GitHub Panel

    4/414

  • 8/14/2019 The GitHub Panel

    5/414

    github.com/schacon

  • 8/14/2019 The GitHub Panel

    6/414

    Scott Chacon has anunderstandable but borderline

    unhealthy obsession with Git

    - Ilya Grigorik

    igvita.com

  • 8/14/2019 The GitHub Panel

    7/414

    git-scm.com

  • 8/14/2019 The GitHub Panel

    8/414

  • 8/14/2019 The GitHub Panel

    9/414

  • 8/14/2019 The GitHub Panel

    10/414

    book.git-scm.com

  • 8/14/2019 The GitHub Panel

    11/414

    [email protected]

  • 8/14/2019 The GitHub Panel

    12/414

  • 8/14/2019 The GitHub Panel

    13/414

    previously, on Git...

  • 8/14/2019 The GitHub Panel

    14/414

    GIT

  • 8/14/2019 The GitHub Panel

    15/414

    Git

  • 8/14/2019 The GitHub Panel

    16/414

  • 8/14/2019 The GitHub Panel

    17/414image by matthew mccullough

  • 8/14/2019 The GitHub Panel

    18/414

    Scott

    v1

    Scott ChaconScott Chacon

    is a Git

    v2 v3

  • 8/14/2019 The GitHub Panel

    19/414

  • 8/14/2019 The GitHub Panel

    20/414

    commit size

    98ca9..

    tree

    author

    committer

    initial commit of my project

    0de24

    Scott

    Scott

    commit size

    34ac2..

    tree

    parent

    author

    committer

    fixed bug #1328 - stack

    overflow under certain

    184ca

    98ca9

    Scott

    Scott

    commit size

    f30ab..

    tree

    parent

    author

    committer

    add feature #32 - ability to

    add new formats to the central

    92ec2

    34ac2

    Scott

    Scott

    snapshot A snapshot B snapshot C

  • 8/14/2019 The GitHub Panel

    21/414

    blob

    size

    e8455..commit size

    98ca9..

    == LICENSE:

    (The MIT License)

    Copyright (c) 2007 Tom Preston-

    Permission is hereby granted, f

    ree of charge, to any person ob

    tree

    parent

    author

    committer

    my commit message goes here

    and it is really, really cool

    0de24

    nil

    Scott

    Scott

    tree size

    10af9..

    blob

    tree

    bc52a

    b70f8

    mylib.rb

    inc

    tree

    size

    b70f8..

    blob 0ad1a tricks.rb

    tree size0de24..

    blob

    tree

    e8455

    10af9

    README

    lib

    blobsize

    bc52a..

    require 'grit/index'

    require 'grit/status'

    module Grit

    class

  • 8/14/2019 The GitHub Panel

    22/414

    blob

    size

    e8455..commit size

    98ca9..

    == LICENSE:

    (The MIT License)

    Copyright (c) 2007 Tom Preston-

    Permission is hereby granted, f

    ree of charge, to any person ob

    tree

    parent

    author

    committer

    my commit message goes here

    and it is really, really cool

    0de24

    nil

    Scott

    Scott

    tree size

    10af9..

    blob

    tree

    bc52a

    b70f8

    mylib.rb

    inc

    tree size

    b70f8..

    blob 0ad1a tricks.rb

    tree size0de24..

    blob

    tree

    e8455

    10af9

    README

    lib

    blobsize

    bc52a..

    require 'grit/index'

    require 'grit/status'

    module Grit

    class

  • 8/14/2019 The GitHub Panel

    23/414

    0de24..22d8858e8513666bf91b82bd2939ec7b0d1974da

  • 8/14/2019 The GitHub Panel

    24/414

  • 8/14/2019 The GitHub Panel

    25/414

    98ca9

    a23fe

    f30ab

    master

    34ac2

    3acd1

    topic

    stable

  • 8/14/2019 The GitHub Panel

    26/414

    98ca9

    a23fe

    f30ab

    master

    34ac2

    3acd1

    topic

    stable

  • 8/14/2019 The GitHub Panel

    27/414

    98ca9

    a23fe

    f30ab

    master

    34ac2

    3acd1

    topic

    stable

  • 8/14/2019 The GitHub Panel

    28/414

    98ca9

    a23fe

    f30ab

    master

    34ac2

    3acd1

    topic

    stable

  • 8/14/2019 The GitHub Panel

    29/414

    $ time git checkout -b newbranch

    Switched to a new branch "newbranch"

    real! 0m0.040suser! 0m0.003ssys!0m0.008s

  • 8/14/2019 The GitHub Panel

    30/414

    $ time git checkout -b newbranch

    Switched to a new branch "newbranch"

    real! 0m0.040suser! 0m0.003ssys!0m0.008s

  • 8/14/2019 The GitHub Panel

    31/414

  • 8/14/2019 The GitHub Panel

    32/414

    master

    develop

    topic

  • 8/14/2019 The GitHub Panel

    33/414

  • 8/14/2019 The GitHub Panel

    34/414

    distributeddevelopment

    image by matthew mccullough

    ccf03da00eca1b60a489354c1278c27f1fbc55dc

  • 8/14/2019 The GitHub Panel

    35/414

    ccf03da00eca1b60a489354c1278c27f1fbc55dc

    a640106f173c5be59ed5757cf33f568b3e10994fc51a137df64b8ed2f8d84ad62df7b49b1c409906

    7e06f7f8d471d5ccbe958fcfaef0fc48ff1a3defdafe95908f7b9cbd2697f04544b68904a6c59aac2934b685f5dfd2b12c5d7d35d07c6058640f0581

    d3b47a90ef9bf2d7bbc5a7cf2b2f27eef4a08f04

    dbfeee0f5717d9978788da17cd6853316c92744a864734938d4044fc5e713e4818f60ecb4f4605253793a0108438a539f958236dbb9f4ea98b6b70ea

    00a60fa1439f082128c1ec03ec3c73acab074d31

    6ba82b4879f04de35ffe2ef02d50df0adf184fad861020b6afeeec245afa2f864c72f5c2588295be

    505f3128a573bfe1d23aec2acef83c34c3cbd8be213e6f8761df038ab0b7c34a9fc4c2c3ce6c8b43

    798a8088bcc7cf47fdb33a9d79e398220b660f88

  • 8/14/2019 The GitHub Panel

    36/414

  • 8/14/2019 The GitHub Panel

    37/414

  • 8/14/2019 The GitHub Panel

    38/414

    C

  • 8/14/2019 The GitHub Panel

    39/414

    fast

  • 8/14/2019 The GitHub Panel

    40/414

    efficient

  • 8/14/2019 The GitHub Panel

    41/414

  • 8/14/2019 The GitHub Panel

    42/414

    100k repos

  • 8/14/2019 The GitHub Panel

    43/414

    80k users

  • 8/14/2019 The GitHub Panel

    44/414

  • 8/14/2019 The GitHub Panel

    45/414

  • 8/14/2019 The GitHub Panel

    46/414

    Git Tips and Tricks

  • 8/14/2019 The GitHub Panel

    47/414

    Tips and Tricks

    Selection and Ranges

    Data Munging

    DebuggingCustomizing

  • 8/14/2019 The GitHub Panel

    48/414

    Selection and Ranges

  • 8/14/2019 The GitHub Panel

    49/414

    Revision Selection

  • 8/14/2019 The GitHub Panel

    50/414

    Revision Selection

    alternate ways to refer toobjects or ranges of objects

  • 8/14/2019 The GitHub Panel

    51/414

    Revision Selection

    full sha-1

    partial sha-1

    branch or tag namecaret parent

    tilde spec

    blob spec

    relative specs

    ranges

  • 8/14/2019 The GitHub Panel

    52/414

    Full SHA1

    6e453f523fa1da50ecb04431101112b3611c6a4d

  • 8/14/2019 The GitHub Panel

    53/414

    Partial SHA16e453f523fa1da50ecb04431101112b3611c6a4d

    6e453f523fa1da50

    6e453

  • 8/14/2019 The GitHub Panel

    54/414

  • 8/14/2019 The GitHub Panel

    55/414

    Caret Parent

    default^2

    2nd parent of default

  • 8/14/2019 The GitHub Panel

    56/414

    !"#"$

    %&'(")

    *"!$+ ,-$*" $"&.- ,-//0 12!&"

    /0/"1 !4 .-,-& !04&"

    5"''6%&'(")

  • 8/14/2019 The GitHub Panel

    57/414

    !"#"$

    %&'(")

    *"!$+ ,-$*" $"&.- ,-//0 12!&"

    /0/"1 !4 .-,-& !04&"

    5"''6%&'(")

    master^

  • 8/14/2019 The GitHub Panel

    58/414

    !"#"$

    %&'(")

    *"!$+ ,-$*" $"&.- ,-//0 12!&"

    /0/"1 !4 .-,-& !04&"

    5"''6%&'(")

    master^2

  • 8/14/2019 The GitHub Panel

    59/414

  • 8/14/2019 The GitHub Panel

    60/414

    !"#"$

    %&'(")

    *"!$+ ,-$*" $"&.- ,-//0 12!&"

    /0/"1 !4 .-,-& !04&"

    5"''6%&'(")

    master~2

    t ^^^2

  • 8/14/2019 The GitHub Panel

    61/414

    !"#"$

    %&'(")

    *"!$+ ,-$*" $"&.- ,-//0 12!&"

    /0/"1 !4 .-,-& !04&"

    5"''6%&'(")

    master^^^2

    master~2^2

    t ^^^2

  • 8/14/2019 The GitHub Panel

    62/414

    !"#"$

    %&'(")

    *"!$+ ,-$*" $"&.- ,-//0 12!&"

    /0/"1 !4 .-,-& !04&"

    5"''6%&'(")

    master^^^2

    master~2^2

    t ^^^2

  • 8/14/2019 The GitHub Panel

    63/414

    !"#"$

    %&'(")

    *"!$+ ,-$*" $"&.- ,-//0 12!&"

    /0/"1 !4 .-,-& !04&"

    5"''6%&'(")

    master^^^2

    master~2^2

  • 8/14/2019 The GitHub Panel

    64/414

    Blob Spec

    default:path/to/file

    blob of that file in default commit

  • 8/14/2019 The GitHub Panel

    65/414

    Relative Specs

    master@{yesterday}

    the commit master was at yesterday

  • 8/14/2019 The GitHub Panel

    66/414

    Relative Specs

    master@{5}

    the 5th prior value of master (locally)

  • 8/14/2019 The GitHub Panel

    67/414

    Ranges

  • 8/14/2019 The GitHub Panel

    68/414

    Ranges

    ce0e4..e4272

    every commit reachable by e4272

    that is not reachable by ce034

  • 8/14/2019 The GitHub Panel

    69/414

    Ranges

    [old]..[new]

    every commit reachable by [new]

    that is not reachable by [old]

  • 8/14/2019 The GitHub Panel

    70/414

    Ranges

    ce0e4..

    everything since a commit

  • 8/14/2019 The GitHub Panel

    71/414

    Reachability

  • 8/14/2019 The GitHub Panel

    72/414

    !"#"$

    %&'(")

    *"!$+ ,-$*" $"&.- ,-//0 12!&"

    /0/"1 !4 .-,-& !04&"

    5"''6%&'(")

    jess/master..master

  • 8/14/2019 The GitHub Panel

    73/414

    !"#"$

    %&'(")

    *"!$+ ,-$*" $"&.- ,-//0 12!&"

    /0/"1 !4 .-,-& !04&"

    5"''6%&'(")

    jess/master..master

  • 8/14/2019 The GitHub Panel

    74/414

  • 8/14/2019 The GitHub Panel

    75/414

  • 8/14/2019 The GitHub Panel

    76/414

    !"#"$

    %&'(")

    *"!$+ ,-$*" $"&.- ,-//0 12!&"

    /0/"1 !4 .-,-& !04&"

    5"''6%&'(")

    jess/master..master

  • 8/14/2019 The GitHub Panel

    77/414

    !"#"$

    %&'(")

    *"!$+ ,-$*" $"&.- ,-//0 12!&"

    /0/"1 !4 .-,-& !04&"

    5"''6%&'(")

    jess/master..master

  • 8/14/2019 The GitHub Panel

    78/414

    jess/master..master

    !"#"$

    %&'(")

    *"!$+ ,-$*" $"&.- ,-//0 12!&"

    /0/"1 !4 .-,-& !04&"

    5"''6%&'(")

  • 8/14/2019 The GitHub Panel

    79/414

    !"#"$

    %&'(")

    *"!$+ ,-$*" $"&.- ,-//0 12!&"

    /0/"1 !4 .-,-& !04&"

    5"''6%&'(")

    jess/master..master

  • 8/14/2019 The GitHub Panel

    80/414

    !"#"$

    %&'(")

    *"!$+ ,-$*" $"&.- ,-//0 12!&"

    /0/"1 !4 .-,-& !04&"

    5"''6%&'(")

    jess/master..c36ae

  • 8/14/2019 The GitHub Panel

    81/414

    !"#"$

    %&'(")

    *"!$+ ,-$*" $"&.- ,-//0 12!&"

    /0/"1 !4 .-,-& !04&"

    5"''6%&'(")

    jess/master..c36ae

  • 8/14/2019 The GitHub Panel

    82/414

    !"#"$

    %&'(")

    *"!$+ ,-$*" $"&.- ,-//0 12!&"

    /0/"1 !4 .-,-& !04&"

    5"''6%&'(")

    jess/master..c36ae

  • 8/14/2019 The GitHub Panel

    83/414

    !"#"$

    %&'(")

    *"!$+ ,-$*" $"&.- ,-//0 12!&"

    /0/"1 !4 .-,-& !04&"

    5"''6%&'(")

    jess/master..c36ae

  • 8/14/2019 The GitHub Panel

    84/414

    Advanced Log

  • 8/14/2019 The GitHub Panel

    85/414

    Log Subsets

  • 8/14/2019 The GitHub Panel

    86/414

    what am I going topush?

  • 8/14/2019 The GitHub Panel

    87/414

    git log origin/master..

  • 8/14/2019 The GitHub Panel

    88/414

    C1

    C0

    origin/master master HEAD

  • 8/14/2019 The GitHub Panel

    89/414

    C1

    C0

    C2

    C3

    C4

    origin/master

    master HEAD

  • 8/14/2019 The GitHub Panel

    90/414

    C1

    C0

    C2

    C3

    C4origin/master master HEAD

    C5

    C6

    C7

    git fetch origin

  • 8/14/2019 The GitHub Panel

    91/414

    C1

    C0

    C2

    C3

    C4origin/master master HEAD

    C5

    C6

    C7

    git log origin/master..

  • 8/14/2019 The GitHub Panel

    92/414

    C1

    C0

    C2

    C3

    C4origin/master master HEAD

    C5

    C6

    C7

    git logorigin/master..HEAD

  • 8/14/2019 The GitHub Panel

    93/414

    C1

    C0

    C2

    C3

    C4origin/master master HEAD

    C5

    C6

    C7

    git logorigin/master..HEAD

  • 8/14/2019 The GitHub Panel

    94/414

  • 8/14/2019 The GitHub Panel

    95/414

    C1

    C0

    C2

    C3

    C4origin/master master HEAD

    C5

    C6

    C7

    git logorigin/master..HEAD

    commit 72d404debaa804fca82fd9cf710fbde48c7305c6

    Author: Shawn O. Pearce

    Date: Sun Oct 12 13:13:59 2008 -0700

  • 8/14/2019 The GitHub Panel

    96/414

    test-lib: fix broken printf

    b8eecafd888d219633f4c29e8b6a90fc21a46dfd introduced usage of

    printf without a format string.

    Signed-off-by: Shawn O. Pearce

    commit 969c877506cf8cc760c7b251fef6c5b6850bfc19

    Author: Jeff King

    Date: Sun Oct 12 00:06:11 2008 -0400

    git apply --directory broken for new files

    We carefully verify that the input to git-apply is sane,

    including cross-checking that the filenames we see in "+++"

    headers match what was provided on the command line of "diff

    --git". When --directory is used, however, we ended up

    comparing the unadorned name to one with the prepended root,

    causing us to complain about a mismatch.

    We simply need to prepend the root directory, if any, whenpulling the name out of the git header.

    commit ff74126c03a8dfd04e7533573a5c420f2a7112ac

    Author: Johannes Schindelin

    Date: Fri Oct 10 13:42:12 2008 +0200

    rebase -i: do not fail when there is no commit to cherry-pick

    commit 72d404debaa804fca82fd9cf710fbde48c7305c6

    Author: Shawn O. Pearce

    Date: Sun Oct 12 13:13:59 2008 -0700

    C4

  • 8/14/2019 The GitHub Panel

    97/414

    test-lib: fix broken printf

    b8eecafd888d219633f4c29e8b6a90fc21a46dfd introduced usage of

    printf without a format string.

    Signed-off-by: Shawn O. Pearce

    commit 969c877506cf8cc760c7b251fef6c5b6850bfc19

    Author: Jeff King

    Date: Sun Oct 12 00:06:11 2008 -0400

    git apply --directory broken for new files

    We carefully verify that the input to git-apply is sane,

    including cross-checking that the filenames we see in "+++"

    headers match what was provided on the command line of "diff

    --git". When --directory is used, however, we ended up

    comparing the unadorned name to one with the prepended root,

    causing us to complain about a mismatch.

    We simply need to prepend the root directory, if any, whenpulling the name out of the git header.

    commit ff74126c03a8dfd04e7533573a5c420f2a7112ac

    Author: Johannes Schindelin

    Date: Fri Oct 10 13:42:12 2008 +0200

    rebase -i: do not fail when there is no commit to cherry-pick

    C2

    C3

  • 8/14/2019 The GitHub Panel

    98/414

    C1

    C0

    C2

    C3

    C4origin/master master HEAD

    C5

    C6

    C7

    git logHEADorigin/master ..

  • 8/14/2019 The GitHub Panel

    99/414

    C1

    C0

    C2

    C3

    C4origin/master master HEAD

    C5

    C6

    C7

    git logHEAD origin/master..

  • 8/14/2019 The GitHub Panel

    100/414

    C1

    C0

    C2

    C3

    C4origin/master master HEAD

    C5

    C6

    C7

    git logHEAD origin/master..

    commits in origin/master

    not in HEAD

  • 8/14/2019 The GitHub Panel

    101/414

    git log origin/master..

    git log origin/master..HEAD

    git log origin/master..master

    git log master ^origin/master

    git log master --not origin/master

  • 8/14/2019 The GitHub Panel

    102/414

    git log HEAD ^origin/master

  • 8/14/2019 The GitHub Panel

    103/414

    git log HEAD ^origin/master

  • 8/14/2019 The GitHub Panel

    104/414

    git log master topic1 ^origin/master

  • 8/14/2019 The GitHub Panel

    105/414

    C1

    C0

    origin/master

  • 8/14/2019 The GitHub Panel

    106/414

    C1

    C0

    C3

    master

    origin/master

  • 8/14/2019 The GitHub Panel

    107/414

    C1

    C0

    C3

    C8

    C9

    master

    experiment

    C10

    origin/master

  • 8/14/2019 The GitHub Panel

    108/414

    C1

    C0

    C2

    C6

    C7

    C3

    C4 C8

    C9C5

    origin/mastermaster

    experiment

    C10

  • 8/14/2019 The GitHub Panel

    109/414

    which changes arent inexperiment?

    git log origin/master master ^experiment

  • 8/14/2019 The GitHub Panel

    110/414

    C1

    C0

    C2

    C6

    C7

    C3

    C4 C8

    C9C5

    origin/mastermaster

    experiment

    C10

    git log origin/master master ^experiment

  • 8/14/2019 The GitHub Panel

    111/414

    C1

    C0

    C2

    C6

    C7

    C3

    C4 C8

    C9C5

    origin/mastermaster

    experiment

    C10

    git log origin/master master ^experiment

  • 8/14/2019 The GitHub Panel

    112/414

    C1

    C0

    C2

    C6

    C7

    C3

    C4 C8

    C9C5

    origin/mastermaster

    experiment

    C10

    git log origin/master master ^experiment

  • 8/14/2019 The GitHub Panel

    113/414

    C1

    C0

    C2

    C6

    C7

    C3

    C4 C8

    C9C5

    origin/mastermaster

    experiment

    C10

    git log origin/master master ^experiment

  • 8/14/2019 The GitHub Panel

    114/414

    C1

    C0

    C2

    C6

    C7

    C3

    C4 C8

    C9C5

    origin/mastermaster

    experiment

    C10

    git log origin/master master ^experiment

  • 8/14/2019 The GitHub Panel

    115/414

    C1

    C0

    C2

    C6

    C7

    C3

    C4 C8

    C9C5

    origin/mastermaster

    experiment

    C10

    git log origin/master master ^experiment

  • 8/14/2019 The GitHub Panel

    116/414

    C1

    C0

    C2

    C6

    C7

    C3

    C4 C8

    C9C5

    origin/mastermaster

    experiment

    C10

  • 8/14/2019 The GitHub Panel

    117/414

    git log --graph

    git log --pretty=oneline --graph

  • 8/14/2019 The GitHub Panel

    118/414

    gitk

  • 8/14/2019 The GitHub Panel

    119/414

    gitk 6d13f..41aba

  • 8/14/2019 The GitHub Panel

    120/414

  • 8/14/2019 The GitHub Panel

    121/414

    Revision Diffs

  • 8/14/2019 The GitHub Panel

    122/414

    git diff revA revB

    $ echo version one > test$ i dd

  • 8/14/2019 The GitHub Panel

    123/414

    C1

    master

    $ git add test$ git commit -m C1

    $ git checkout -b topic

  • 8/14/2019 The GitHub Panel

    124/414

    g p

    $ echo version two >> test

    $ git commit -m C2

    C1

    C2master

    topic

    $ echo version three >> test

  • 8/14/2019 The GitHub Panel

    125/414

    $ git commit -m C3

    C1

    C2

    C3

    master

    topic

    $ git checkout master

    $ echo version four >> test

  • 8/14/2019 The GitHub Panel

    126/414

    $$ git commit -m C4

    C1

    C4 C2

    C3

    master

    topic

    $ echo version five >> test$ it it C5

  • 8/14/2019 The GitHub Panel

    127/414

    $ git commit -m C5

    C1

    C4

    C5

    C2

    C3

    master topic

  • 8/14/2019 The GitHub Panel

    128/414

    C1

    C4

    C5

    C2

    C3

    master topic

    $ git diff topic

  • 8/14/2019 The GitHub Panel

    129/414

    $ git diff topic

    C1

    C4

    C5

    C2

    C3

    master topic

    what does topic have

    that I dont have?

  • 8/14/2019 The GitHub Panel

    130/414

    $ git diff topic

    C1

    C4

    C5

    C2

    C3

    master topic

    what would happen if I

    merged in topic?

  • 8/14/2019 The GitHub Panel

    131/414

    $ git diff topic

    C1

    C4

    C5

    C2

    C3

    master topic

    how do I make topic

    look like HEAD?

  • 8/14/2019 The GitHub Panel

    132/414

    $ git diff topic

    C1

    C4

    C5

    C2

    C3

    master topicdiff --git a/test b/test

    index 304313d..bd8c6c9 100644--- a/test

    +++ b/test@@ -1,3 +1,3 @@

    version one-version two

    -version three+version four

    +version five

  • 8/14/2019 The GitHub Panel

    133/414

    $ git diff topic

    C1

    C4

    C5

    C2

    C3

    master topicdiff --git a/test b/test

    index 304313d..bd8c6c9 100644--- a/test

    +++ b/test@@ -1,3 +1,3 @@

    version one-version two

    -version three+version four

    +version five

  • 8/14/2019 The GitHub Panel

    134/414

    $ git diff HEAD topic

    C1

    C4

    C5

    C2

    C3

    master topicdiff --git a/test b/test

    index bd8c6c9..304313d 100644--- a/test

    +++ b/test@@ -1,3 +1,3 @@

    version one-version four

    -version five+version two

    +version three

  • 8/14/2019 The GitHub Panel

    135/414

    $ git diff HEAD topic

    C1

    C4

    C5

    C2

    C3

    master topicdiff --git a/test b/test

    index bd8c6c9..304313d 100644--- a/test

    +++ b/test@@ -1,3 +1,3 @@

    version one-version four

    -version five+version two

    +version three

  • 8/14/2019 The GitHub Panel

    136/414

    git diff HEAD topic

  • 8/14/2019 The GitHub Panel

    137/414

    git diff HEAD...topic

  • 8/14/2019 The GitHub Panel

    138/414

    git diff HEAD...topic

    $ git diff HEAD topic

  • 8/14/2019 The GitHub Panel

    139/414

    $ git diff HEAD topic

    C1

    C4

    C5

    C2

    C3

    master topic

    $ git diff HEAD topic

  • 8/14/2019 The GitHub Panel

    140/414

    $ git diff HEAD topic

    C1

    C4

    C5

    C2

    C3

    master topic

  • 8/14/2019 The GitHub Panel

    141/414

    $ git diff HEAD topic

  • 8/14/2019 The GitHub Panel

    142/414

    $ git diff HEAD...topic

    C1

    C4

    C5

    C2

    C3

    master topic

    diff --git a/test b/testindex 9bc69cf..304313d 100644--- a/test

    +++ b/test@@ -1 +1,3 @@

    version one+version two

    +version three

    $ git diff HEAD topic

  • 8/14/2019 The GitHub Panel

    143/414

    $ git diff HEAD...topic

    C1

    C4

    C5

    C2

    C3

    master topic

    diff --git a/test b/testindex 9bc69cf..304313d 100644--- a/test

    +++ b/test@@ -1 +1,3 @@

    version one+version two

    +version three

    what would happen if I

    merged in topic?

  • 8/14/2019 The GitHub Panel

    144/414

    Data Munging

  • 8/14/2019 The GitHub Panel

    145/414

    Rewriting History

  • 8/14/2019 The GitHub Panel

    146/414

    Modifying the last commit

  • 8/14/2019 The GitHub Panel

    147/414

    git commit --amend

  • 8/14/2019 The GitHub Panel

    148/414

    Rebasing

  • 8/14/2019 The GitHub Panel

    149/414

    C1

    C4

    C5

    C2

    C3

    master topic

    topic

  • 8/14/2019 The GitHub Panel

    150/414

    git merge masterC1

    C4

    C5

    C2

    C3

    master C6

  • 8/14/2019 The GitHub Panel

    151/414

    C1

    C4

    C5

    C2

    C3

    master topic

    git rebase master

  • 8/14/2019 The GitHub Panel

    152/414

    C1

    C4

    C5

    C2

    C3

    master topic

    git rebase master

  • 8/14/2019 The GitHub Panel

    153/414

  • 8/14/2019 The GitHub Panel

    154/414

    C1

    C4

    C5

    C2

    C3

    master topic

    git rebase master

  • 8/14/2019 The GitHub Panel

    155/414

    C1

    C4

    C5

    C2

    C3

    master topic

    git diff c2 c3 > 2-3.patch

  • 8/14/2019 The GitHub Panel

    156/414

    diff --git a/test b/test

    index 2eadcec..bd8c6c9 100644

    --- a/test

    +++ b/test

    @@ -1,2 +1,3 @@

    version oneversion four

    +version fiveC1

    C4

    C5

    C2

    C3

    master topic

    git diff c2 c3 > 2-3.patch

  • 8/14/2019 The GitHub Panel

    157/414

    2-3.patch

    C1

    C4

    C5

    C2

    C3

    master topic

  • 8/14/2019 The GitHub Panel

    158/414

    2-3.patch

    C1

    C4

    C5

    C2

    C3

    master topic

    git diff c1 c2 > 1-2.patch

  • 8/14/2019 The GitHub Panel

    159/414

    2-3.patch

    C1

    C4

    C5

    C2

    C3

    master topic

    git diff c1 c2 > 1-2.patch1-2.patch

  • 8/14/2019 The GitHub Panel

    160/414

    1-2.patch

    2-3.patch

    C1

    C4

    C5

    C2

    C3

    master topic

    git rebase master

  • 8/14/2019 The GitHub Panel

    161/414

    1-2.patch

    2-3.patch

    C1

    C4

    C5

    C2

    C3

    master topic

    git rebase master

  • 8/14/2019 The GitHub Panel

    162/414

    2-3.patch

    C1

    C4

    C5

    C2

    C3

    master topic1-2.patch

    git rebase master

    topic

  • 8/14/2019 The GitHub Panel

    163/414

    2-3.patch

    C1

    C4

    C5

    C2

    C3

    masterC2'

    2-3.patchgit rebase master

    topic

  • 8/14/2019 The GitHub Panel

    164/414

    C1

    C4

    C5

    C2

    C3

    masterC2'

    git rebase mastertopic

    C3'

  • 8/14/2019 The GitHub Panel

    165/414

    C1

    C4

    C5

    C2

    C3

    masterC2'

    C3

    topic

  • 8/14/2019 The GitHub Panel

    166/414

    git rebase master

    C1

    C4

    C5

    C2

    C3

    masterC2'

    C3'

  • 8/14/2019 The GitHub Panel

    167/414

    topic

    topic

  • 8/14/2019 The GitHub Panel

    168/414

    C1

    C4

    C5master

    C2'

    C3'

    git rebase masterC2'

    C3'

    C1

    C4

    C5master

  • 8/14/2019 The GitHub Panel

    169/414

    Fun with Rebasing

  • 8/14/2019 The GitHub Panel

    170/414

    rebase --onto

  • 8/14/2019 The GitHub Panel

    171/414

    Transplanting TopicBranches

    master

  • 8/14/2019 The GitHub Panel

    172/414

    C1 C2

    master

  • 8/14/2019 The GitHub Panel

    173/414

    C1 C2C1 C2

    C3

    server

    master

  • 8/14/2019 The GitHub Panel

    174/414

    C1 C2

    C3

    C8 C9

    client

    C1 C2

    server

    master

  • 8/14/2019 The GitHub Panel

    175/414

    C1 C2

    server

    C3 C4

    C8

    C10

    C9

    client

    master

  • 8/14/2019 The GitHub Panel

    176/414

    C1 C2 C5

    server

    C3 C4

    C6

    C8

    C10

    C9

    client

  • 8/14/2019 The GitHub Panel

    177/414

    move your client

    branch work to yourmaster branch

    master

  • 8/14/2019 The GitHub Panel

    178/414

    C1 C2 C5

    server

    C3 C4

    C6

    C8

    C10

    C9

    client

  • 8/14/2019 The GitHub Panel

    179/414

    master

  • 8/14/2019 The GitHub Panel

    180/414

    C1 C2 C5

    server

    C3 C4

    C6

    C8

    C10

    C9

    client

    git rebase master

    master

  • 8/14/2019 The GitHub Panel

    181/414

    C1 C2 C5

    server

    C3 C4

    C6

    C8

    C10

    C9

    client

    git rebase master

    master

  • 8/14/2019 The GitHub Panel

    182/414

    C1 C2 C5

    server

    C3 C4

    C6

    C8

    C10

    C9

    client

    git rebase master

  • 8/14/2019 The GitHub Panel

    183/414

    master

  • 8/14/2019 The GitHub Panel

    184/414

    C1 C2 C5

    server

    C3 C4

    C6

    C8

    C10

    C9

    client

    git rebase server

  • 8/14/2019 The GitHub Panel

    185/414

    master

  • 8/14/2019 The GitHub Panel

    186/414

    C1 C2 C5

    server

    C3 C4

    C6

    C8

    C10

    C9

    client

    git rebase server

    master

  • 8/14/2019 The GitHub Panel

    187/414

    C1 C2 C5

    server

    C3 C4

    C6

    C8

    C10

    C9

    client

    git rebase server

    master

  • 8/14/2019 The GitHub Panel

    188/414

    C1 C2 C5

    server

    C3 C4

    C6

    C8

    C10

    C9

    client

    git rebase --onto master server

    master

  • 8/14/2019 The GitHub Panel

    189/414

    C1 C2 C5

    server

    C3 C4

    C6

    C8

    C10

    C9

    client

    git rebase --onto master server

    master

  • 8/14/2019 The GitHub Panel

    190/414

    C1 C2 C5

    server

    C3 C4

    C6

    C8

    C10

    C9

    client

    git rebase --onto master server

    master

  • 8/14/2019 The GitHub Panel

    191/414

    C1 C2 C5

    server

    C3 C4

    C6

    C8

    C10

    C9

    client

    C8 C9

    git rebase --onto master server

    master

    clientmaster

  • 8/14/2019 The GitHub Panel

    192/414

    C8 C9C1 C2 C5

    server

    C3 C4

    C6

    C8

    C10

    C9

    C8' C9'C1 C2 C5

    server

    C3 C4

    C6

    C8

    C10

    C9

    client

    master client

  • 8/14/2019 The GitHub Panel

    193/414

    C1 C2 C5

    server

    C3 C4

    C6

    C8

    C10

    C9

    C8' C9'

    master client

  • 8/14/2019 The GitHub Panel

    194/414

    C1 C2 C5

    server

    C3 C4

    C6

    C8

    C10

    C9

    C8' C9'

    git checkout server

    git rebase master

    master client

  • 8/14/2019 The GitHub Panel

    195/414

    C1 C2 C5

    server

    C3 C4

    C6

    C8

    C10

    C9

    C8' C9'

    git checkout server

    git rebase client

    master client

  • 8/14/2019 The GitHub Panel

    196/414

    C1 C2 C5

    server

    C3 C4

    C6

    C8

    C10

    C9

    C8' C9'

    git checkout server

    git rebase client

  • 8/14/2019 The GitHub Panel

    197/414

    client

    client servermaster

  • 8/14/2019 The GitHub Panel

    198/414

    git checkout server

    git rebase client

    C1 C2 C5 C6 C8' C9' C3' C4' C10'C1 C2 C5 C6 C8' C9' C3' C4' C10'

    client servermaster

  • 8/14/2019 The GitHub Panel

    199/414

    C1 C2 C5 C6 C8' C9' C3' C4' C10'

    git checkout server

    git rebase client

  • 8/14/2019 The GitHub Panel

    200/414

    transplant some of a

    topic branch

    master

  • 8/14/2019 The GitHub Panel

    201/414

    C1C0 C2

    C3

    topic

    C4 C5

    master

  • 8/14/2019 The GitHub Panel

    202/414

    C1C0 C2

    C3

    topic

    C4 C5

    master

  • 8/14/2019 The GitHub Panel

    203/414

    git branch newtopic C3

    C1C0 C2

    C3

    topic

    C4 C5

    master

  • 8/14/2019 The GitHub Panel

    204/414

    git branch newtopic C3

    newtopic

    C1C0 C2

    C3

    topic

    C4 C5

    master

  • 8/14/2019 The GitHub Panel

    205/414

    git branch newtopic C3

    git rebase --onto master newtopic

    newtopic

    C1C0 C2

    C3

    topic

    C4 C5

    master topic

  • 8/14/2019 The GitHub Panel

    206/414

    C1C0 C2

    C3 C4 C5

    C4' C5'

    git branch newtopic C3

    git rebase --onto master newtopic

    newtopic

  • 8/14/2019 The GitHub Panel

    207/414

    Fixing a commit

    several back

  • 8/14/2019 The GitHub Panel

    208/414

    git rebase -igit rebase --interactive

  • 8/14/2019 The GitHub Panel

    209/414

    C4

    default

  • 8/14/2019 The GitHub Panel

    210/414

    C1

    C0

    C2

    C3

    C4

    default

  • 8/14/2019 The GitHub Panel

    211/414

    C1

    C0

    C2

    C3

    default~2

    C4

    default

  • 8/14/2019 The GitHub Panel

    212/414

    C1

    C0

    C2

    C3

    default~2

  • 8/14/2019 The GitHub Panel

    213/414

    git rebase -i default~2^

  • 8/14/2019 The GitHub Panel

    214/414

    git rebase -i default~2^

  • 8/14/2019 The GitHub Panel

    215/414

    git rebase -i default~2^

    pick 969c877 git apply --directory broken for new files

    pick b75271d git diff {3,}: do not reverse order of args

    pick 72d404d test-lib: fix broken printf

    # Rebase f285a2d 5c283eb onto f285a2d

  • 8/14/2019 The GitHub Panel

    216/414

    # Rebase f285a2d..5c283eb onto f285a2d

    #

    # Commands:

    # p, pick = use commit

    # e, edit = use commit, but stop for amending

    # s, squash = use commit, but meld into previous commit

    #

    # If you remove a line here THAT COMMIT WILL BE LOST.# However, if you remove everything, the rebase will be aborted.

    #

    ~

    ~

    ~

    ~~

    "~/projects/git/.git/rebase-merge/git-rebase-todo" 14L, 472C

    pick 969c877 git apply --directory broken for new files

    pick b75271d git diff {3,}: do not reverse order of args

    pick 72d404d test-lib: fix broken printf

    # Rebase f285a2d 5c283eb onto f285a2d

    C2

    C3

    C4

  • 8/14/2019 The GitHub Panel

    217/414

    # Rebase f285a2d..5c283eb onto f285a2d

    #

    # Commands:

    # p, pick = use commit

    # e, edit = use commit, but stop for amending

    # s, squash = use commit, but meld into previous commit

    #

    # If you remove a line here THAT COMMIT WILL BE LOST.# However, if you remove everything, the rebase will be aborted.

    #

    ~

    ~

    ~

    ~~

    "~/projects/git/.git/rebase-merge/git-rebase-todo" 14L, 472C

    pick 969c877 git apply --directory broken for new files

    pick b75271d git diff {3,}: do not reverse order of args

    pick 72d404d test-lib: fix broken printf

    # Rebase f285a2d 5c283eb onto f285a2d

  • 8/14/2019 The GitHub Panel

    218/414

    # Rebase f285a2d..5c283eb onto f285a2d

    #

    # Commands:

    # p, pick = use commit

    # e, edit = use commit, but stop for amending

    # s, squash = use commit, but meld into previous commit

    #

    # If you remove a line here THAT COMMIT WILL BE LOST.# However, if you remove everything, the rebase will be aborted.

    #

    ~

    ~

    ~

    ~~

    "~/projects/git/.git/rebase-merge/git-rebase-todo" 14L, 472C

    pick 969c877 git apply --directory broken for new files

    pick b75271d git diff {3,}: do not reverse order of args

    pick 72d404d test-lib: fix broken printf

    # Rebase f285a2d 5c283eb onto f285a2d

  • 8/14/2019 The GitHub Panel

    219/414

    # Rebase f285a2d..5c283eb onto f285a2d

    #

    # Commands:

    # p, pick = use commit

    # e, edit = use commit, but stop for amending

    # s, squash = use commit, but meld into previous commit

    #

    # If you remove a line here THAT COMMIT WILL BE LOST.# However, if you remove everything, the rebase will be aborted.

    #

    ~

    ~

    ~

    ~~

    "~/projects/git/.git/rebase-merge/git-rebase-todo" 14L, 472C

    pick 969c877 git apply --directory broken for new files

    pick b75271d git diff {3,}: do not reverse order of args

    pick 72d404d test-lib: fix broken printf

    # Rebase f285a2d 5c283eb onto f285a2d

  • 8/14/2019 The GitHub Panel

    220/414

    # Rebase f285a2d..5c283eb onto f285a2d

    #

    # Commands:

    # p, pick = use commit

    # e, edit = use commit, but stop for amending

    # s, squash = use commit, but meld into previous commit

    #

    # If you remove a line here THAT COMMIT WILL BE LOST.# However, if you remove everything, the rebase will be aborted.

    #

    ~

    ~

    ~

    ~~

    "~/projects/git/.git/rebase-merge/git-rebase-todo" 14L, 472C

  • 8/14/2019 The GitHub Panel

    221/414

    pick 969c877 git apply --directory broken for new files

    pick b75271d git diff {3,}: do not reverse order of args

    pick 72d404d test-lib: fix broken printf

    # Rebase f285a2d 5c283eb onto f285a2d

  • 8/14/2019 The GitHub Panel

    222/414

    # Rebase f285a2d..5c283eb onto f285a2d

    #

    # Commands:

    # p, pick = use commit

    # e, edit = use commit, but stop for amending

    # s, squash = use commit, but meld into previous commit

    #

    # If you remove a line here THAT COMMIT WILL BE LOST.# However, if you remove everything, the rebase will be aborted.

    #

    ~

    ~

    ~

    ~~

    "~/projects/git/.git/rebase-merge/git-rebase-todo" 14L, 472C

    edit 969c877 git apply --directory broken for new files

    pick b75271d git diff {3,}: do not reverse order of args

    pick 72d404d test-lib: fix broken printf

    # Rebase f285a2d..5c283eb onto f285a2d

  • 8/14/2019 The GitHub Panel

    223/414

    # Rebase f285a2d..5c283eb onto f285a2d

    #

    # Commands:

    # p, pick = use commit

    # e, edit = use commit, but stop for amending

    # s, squash = use commit, but meld into previous commit

    #

    # If you remove a line here THAT COMMIT WILL BE LOST.# However, if you remove everything, the rebase will be aborted.

    #

    ~

    ~

    ~

    ~~

    "~/projects/git/.git/rebase-merge/git-rebase-todo" 14L, 472C

    $ git rebase -i default~2^

    Stopped at 969c877... git apply --directory broken for new files

    You can amend the commit now, with

    git commit --amend

  • 8/14/2019 The GitHub Panel

    224/414

    g

    Once you are satisfied with your changes, run

    git rebase --continue

    $_

    $ git rebase -i default~2^

    Stopped at 969c877... git apply --directory broken for new files

    You can amend the commit now, with

    git commit --amend

  • 8/14/2019 The GitHub Panel

    225/414

    Once you are satisfied with your changes, run

    git rebase --continue

    $_

    edit filesgit add

    git commit --amendgit rebase --continue

    $ git rebase -i default~2^

    Stopped at 969c877... git apply --directory broken for new files

    You can amend the commit now, with

    git commit --amend

  • 8/14/2019 The GitHub Panel

    226/414

    Once you are satisfied with your changes, run

    git rebase --continue

    $_

    edit filesgit add

    git commit --amendgit rebase --continue

    $ git rebase -i default~2^

    Stopped at 969c877... git apply --directory broken for new files

    You can amend the commit now, with

    git commit --amend

  • 8/14/2019 The GitHub Panel

    227/414

    Once you are satisfied with your changes, run

    git rebase --continue

    $_

    edit filesgit add

    git commit --amendgit rebase --continue

    $ git rebase -i default~2^

    Stopped at 969c877... git apply --directory broken for new files

    You can amend the commit now, with

    git commit --amend

  • 8/14/2019 The GitHub Panel

    228/414

    Once you are satisfied with your changes, run

    git rebase --continue

    $_

    edit filesgit add

    git commit --amendgit rebase --continue

    C4

    default

    C4'

  • 8/14/2019 The GitHub Panel

    229/414

    C1

    C0

    C2

    C3

    C2'

    C3'

    C4

    default

    C4'

  • 8/14/2019 The GitHub Panel

    230/414

    C1

    C0

    C2

    C3

    C2'

    C3'

    C4

    default

    C4'

  • 8/14/2019 The GitHub Panel

    231/414

    C1

    C0

    C2

    C3

    C2'

    C3'

  • 8/14/2019 The GitHub Panel

    232/414

    Squashing commits

    together

    pick 969c877 git apply --directory broken for new files

    pick b75271d git diff {3,}: do not reverse order of args

    pick 72d404d test-lib: fix broken printf

    # Rebase f285a2d..5c283eb onto f285a2d

  • 8/14/2019 The GitHub Panel

    233/414

    ## Commands:

    # p, pick = use commit

    # e, edit = use commit, but stop for amending

    # s, squash = use commit, but meld into previous commit

    #

    # If you remove a line here THAT COMMIT WILL BE LOST.# However, if you remove everything, the rebase will be aborted.

    #

    ~

    ~

    ~

    ~~

    "~/projects/git/.git/rebase-merge/git-rebase-todo" 14L, 472C

    pick 969c877 git apply --directory broken for new files

    squash b75271d git diff {3,}: do not reverse order of args

    squash 72d404d test-lib: fix broken printf

    # Rebase f285a2d..5c283eb onto f285a2d

  • 8/14/2019 The GitHub Panel

    234/414

    ## Commands:

    # p, pick = use commit

    # e, edit = use commit, but stop for amending

    # s, squash = use commit, but meld into previous commit

    #

    # If you remove a line here THAT COMMIT WILL BE LOST.# However, if you remove everything, the rebase will be aborted.

    #

    ~

    ~

    ~

    ~~

    "~/projects/git/.git/rebase-merge/git-rebase-todo" 14L, 472C

    # This is a combination of 3 commits.# The first commit's message is:

    git apply --directory broken for new files

    # This is the 2nd commit message:

    git diff {3,}: do not reverse order of args

  • 8/14/2019 The GitHub Panel

    235/414

    # This is the 3rd commit message:

    test-lib: fix broken printf

    # Please enter the commit message for your changes. Lines starting

    # with '#' will be ignored, and an empty message aborts the commit.

    #

    # Author: Jeff King

    #

    # Not currently on any branch.

    # Changes to be committed:

    # (use "git reset HEAD ..." to unstage)

    #

    # modified: builtin-apply.c

    # modified: builtin-diff.c

    # modified: t/t4013-diff-various.sh

    # new file: t/t4013/diff.diff_master_master^_side

    # modified: t/t4128-apply-root.sh# modified: t/test-lib.sh

    #

    ~

    ~

    ".git/COMMIT_EDITMSG" 39L, 1454C

    # This is a combination of 3 commits.# The first commit's message is:

    git apply --directory broken for new files

    # This is the 2nd commit message:

    git diff {3,}: do not reverse order of args

  • 8/14/2019 The GitHub Panel

    236/414

    # This is the 3rd commit message:

    test-lib: fix broken printf

    # Please enter the commit message for your changes. Lines starting

    # with '#' will be ignored, and an empty message aborts the commit.

    #

    # Author: Jeff King

    #

    # Not currently on any branch.

    # Changes to be committed:

    # (use "git reset HEAD ..." to unstage)

    #

    # modified: builtin-apply.c

    # modified: builtin-diff.c

    # modified: t/t4013-diff-various.sh

    # new file: t/t4013/diff.diff_master_master^_side

    # modified: t/t4128-apply-root.sh# modified: t/test-lib.sh

    #

    ~

    ~

    ".git/COMMIT_EDITMSG" 39L, 1454C

    # This is a combination of 3 commits.# The first commit's message is:

    git apply --directory broken for new files

    # This is the 2nd commit message:

    git diff {3,}: do not reverse order of args

  • 8/14/2019 The GitHub Panel

    237/414

    # This is the 3rd commit message:

    test-lib: fix broken printf

    # Please enter the commit message for your changes. Lines starting

    # with '#' will be ignored, and an empty message aborts the commit.

    #

    # Author: Jeff King

    #

    # Not currently on any branch.

    # Changes to be committed:

    # (use "git reset HEAD ..." to unstage)

    #

    # modified: builtin-apply.c

    # modified: builtin-diff.c

    # modified: t/t4013-diff-various.sh

    # new file: t/t4013/diff.diff_master_master^_side

    # modified: t/t4128-apply-root.sh# modified: t/test-lib.sh

    #

    ~

    ~

    ".git/COMMIT_EDITMSG" 39L, 1454C

    # This is a combination of 3 commits.# The first commit's message is:

    git apply --directory broken for new files

    # This is the 2nd commit message:

    git diff {3,}: do not reverse order of args

  • 8/14/2019 The GitHub Panel

    238/414

    # This is the 3rd commit message:

    test-lib: fix broken printf

    # Please enter the commit message for your changes. Lines starting

    # with '#' will be ignored, and an empty message aborts the commit.

    #

    # Author: Jeff King

    #

    # Not currently on any branch.

    # Changes to be committed:

    # (use "git reset HEAD ..." to unstage)

    #

    # modified: builtin-apply.c

    # modified: builtin-diff.c

    # modified: t/t4013-diff-various.sh

    # new file: t/t4013/diff.diff_master_master^_side

    # modified: t/t4128-apply-root.sh# modified: t/test-lib.sh

    #

    ~

    ~

    ".git/COMMIT_EDITMSG" 39L, 1454C

    C4

  • 8/14/2019 The GitHub Panel

    239/414

    C1

    C0

    C2

    C3

    default

    C5

  • 8/14/2019 The GitHub Panel

    240/414

    scott jessica

  • 8/14/2019 The GitHub Panel

    241/414

    C1

    C0

    default

    scott jessica

  • 8/14/2019 The GitHub Panel

    242/414

    C0

    default

    C1

    C0

    scott/default

    default

    C2

    C3

    C4

    C1

    scott jessica

  • 8/14/2019 The GitHub Panel

    243/414

    C0

    C5

    C6

    C7

    default

    C1

    C0

    scott/default default

    C2

    C3

    C4

    C1

    C5

    C6

    C7

    scott jessica

    default

  • 8/14/2019 The GitHub Panel

    244/414

    C0

    C5

    C6

    C7

    default

    C1

    C0

    scott/default

    C2

    C3

    C4

    C1

    C5

    C6

    C7

    C8

    scott jessica

    default

  • 8/14/2019 The GitHub Panel

    245/414

    C0

    C5

    C6

    C7

    default

    C1

    C0

    scott/default

    C2

    C3

    C4

    C1

    C5

    C6

    C7

    C5'

    C6'

    C7'

    C8

  • 8/14/2019 The GitHub Panel

    246/414

    scott jessica

    default

    C9

  • 8/14/2019 The GitHub Panel

    247/414

    C0

    C5

    C6

    C7

    default

    C1

    C0

    scott/default

    C2

    C3

    C4

    C1

    C5

    C6

    C7

    C5'

    C6'

    C7'

    C8

    C5'

    C6'

    C7'

  • 8/14/2019 The GitHub Panel

    248/414

    Filter BranchHistory Revision on Steroids

  • 8/14/2019 The GitHub Panel

    249/414

    remove all instances of a

    file from every commit

  • 8/14/2019 The GitHub Panel

    250/414

    git filter-branch--tree-filter 'rm -f filename'

    HEAD

  • 8/14/2019 The GitHub Panel

    251/414

    change your email

    in all commits

  • 8/14/2019 The GitHub Panel

    252/414

    git filter-branch --env-filter

    "export [email protected]"HEAD

    mailto:[email protected]:[email protected]
  • 8/14/2019 The GitHub Panel

    253/414

    git filter-branch --env-filter

    "export [email protected]"origin/master..HEAD

    mailto:[email protected]:[email protected]
  • 8/14/2019 The GitHub Panel

    254/414

    Subtree Merging

  • 8/14/2019 The GitHub Panel

    255/414

    Alternative to

    Submodules

    $ lsREADME! ! rack_app.rb$ git remote add rack_remote [email protected]:schacon/rack.git$ git fetch rack_remotewarning: no common commits

    t C ti bj t 3184 d

  • 8/14/2019 The GitHub Panel

    256/414

    remote: Counting objects: 3184, done.remote: Compressing objects: 100% (1465/1465), done.remote: Total 3184 (delta 1952), reused 2770 (delta 1675)Receiving objects: 100% (3184/3184), 677.42 KiB | 4 KiB/s, d

    Resolving deltas: 100% (1952/1952), done.From [email protected]:schacon/rack* [new branch] master -> rack_remote/master$ git checkout -b rack_branch rack_remote/masterBranch rack_branch set up to track remote branch refs/remote

    Switched to a new branch "rack_branch"$ lsAUTHORS!! KNOWN-ISSUES! Rakefile!contrib!! libCOPYING!! README! ! bin! ! example!! test

    t

  • 8/14/2019 The GitHub Panel

    257/414

    C1

    C0

    master

    C2

    C3

    $ lsREADME! ! rack_app.rb$ git remote add rack_remote [email protected]:schacon/rack.git$ git fetch rack_remotewarning: no common commits

    t C ti bj t 3184 d

  • 8/14/2019 The GitHub Panel

    258/414

    remote: Counting objects: 3184, done.remote: Compressing objects: 100% (1465/1465), done.remote: Total 3184 (delta 1952), reused 2770 (delta 1675)Receiving objects: 100% (3184/3184), 677.42 KiB | 4 KiB/s, d

    Resolving deltas: 100% (1952/1952), done.From [email protected]:schacon/rack* [new branch] master -> rack_remote/master$ git checkout -b rack_branch rack_remote/masterBranch rack_branch set up to track remote branch refs/remote

    Switched to a new branch "rack_branch"$ lsAUTHORS!! KNOWN-ISSUES! Rakefile!contrib!! libCOPYING!! README! ! bin! ! example!! test

    $ lsREADME! ! rack_app.rb$ git remote add rack_remote [email protected]:schacon/rack.git$ git fetch rack_remotewarning: no common commitsremote: Co nting objects: 3184 done

  • 8/14/2019 The GitHub Panel

    259/414

    remote: Counting objects: 3184, done.remote: Compressing objects: 100% (1465/1465), done.remote: Total 3184 (delta 1952), reused 2770 (delta 1675)Receiving objects: 100% (3184/3184), 677.42 KiB | 4 KiB/s, d

    Resolving deltas: 100% (1952/1952), done.From [email protected]:schacon/rack* [new branch] master -> rack_remote/master$ git checkout -b rack_branch rack_remote/masterBranch rack_branch set up to track remote branch refs/remote

    Switched to a new branch "rack_branch"$ lsAUTHORS!! KNOWN-ISSUES! Rakefile!contrib!! libCOPYING!! README! ! bin! ! example!! test

    $ lsREADME! ! rack_app.rb$ git remote add rack_remote [email protected]:schacon/rack.git$ git fetch rack_remotewarning: no common commitsremote: Counting objects: 3184 done

  • 8/14/2019 The GitHub Panel

    260/414

    remote: Counting objects: 3184, done.remote: Compressing objects: 100% (1465/1465), done.remote: Total 3184 (delta 1952), reused 2770 (delta 1675)Receiving objects: 100% (3184/3184), 677.42 KiB | 4 KiB/s, d

    Resolving deltas: 100% (1952/1952), done.From [email protected]:schacon/rack* [new branch] master -> rack_remote/master$ git checkout -b rack_branch rack_remote/masterBranch rack_branch set up to track remote branch refs/remote

    Switched to a new branch "rack_branch"$ lsAUTHORS!! KNOWN-ISSUES! Rakefile!contrib!! libCOPYING!! README! ! bin! ! example!! test

    $ lsREADME! ! rack_app.rb$ git remote add rack_remote [email protected]:schacon/rack.git$ git fetch rack_remotewarning: no common commitsremote: Counting objects: 3184 done

  • 8/14/2019 The GitHub Panel

    261/414

    remote: Counting objects: 3184, done.remote: Compressing objects: 100% (1465/1465), done.remote: Total 3184 (delta 1952), reused 2770 (delta 1675)Receiving objects: 100% (3184/3184), 677.42 KiB | 4 KiB/s, d

    Resolving deltas: 100% (1952/1952), done.From [email protected]:schacon/rack* [new branch] master -> rack_remote/master$ git checkout -b rack_branch rack_remote/masterBranch rack_branch set up to track remote branch refs/remote

    Switched to a new branch "rack_branch"$ lsAUTHORS!! KNOWN-ISSUES! Rakefile!contrib!! libCOPYING!! README! ! bin! ! example!! test

    $ lsREADME! ! rack_app.rb$ git remote add rack_remote [email protected]:schacon/rack.git$ git fetch rack_remotewarning: no common commitsremote: Counting objects: 3184 done

  • 8/14/2019 The GitHub Panel

    262/414

    remote: Counting objects: 3184, done.remote: Compressing objects: 100% (1465/1465), done.remote: Total 3184 (delta 1952), reused 2770 (delta 1675)Receiving objects: 100% (3184/3184), 677.42 KiB | 4 KiB/s, d

    Resolving deltas: 100% (1952/1952), done.From [email protected]:schacon/rack* [new branch] master -> rack_remote/master$ git checkout -b rack_branch rack_remote/masterBranch rack_branch set up to track remote branch refs/remote

    Switched to a new branch "rack_branch"$ lsAUTHORS!! KNOWN-ISSUES! Rakefile!contrib!! libCOPYING!! README! ! bin! ! example!! test

    $ lsREADME! ! rack_app.rb$ git remote add rack_remote [email protected]:schacon/rack.git$ git fetch rack_remotewarning: no common commitsremote: Counting objects: 3184 done

  • 8/14/2019 The GitHub Panel

    263/414

    remote: Counting objects: 3184, done.remote: Compressing objects: 100% (1465/1465), done.remote: Total 3184 (delta 1952), reused 2770 (delta 1675)Receiving objects: 100% (3184/3184), 677.42 KiB | 4 KiB/s, dResolving deltas: 100% (1952/1952), done.From [email protected]:schacon/rack* [new branch] master -> rack_remote/master$ git checkout -b rack_branch rack_remote/masterBranch rack_branch set up to track remote branch refs/remote

    Switched to a new branch "rack_branch"$ lsAUTHORS!! KNOWN-ISSUES! Rakefile!contrib!! libCOPYING!! README! ! bin! ! example!! test

    $ lsREADME! ! rack_app.rb$ git remote add rack_remote [email protected]:schacon/rack.git$ git fetch rack_remotewarning: no common commitsremote: Counting objects: 3184 done

  • 8/14/2019 The GitHub Panel

    264/414

    remote: Counting objects: 3184, done.remote: Compressing objects: 100% (1465/1465), done.remote: Total 3184 (delta 1952), reused 2770 (delta 1675)Receiving objects: 100% (3184/3184), 677.42 KiB | 4 KiB/s, dResolving deltas: 100% (1952/1952), done.From [email protected]:schacon/rack* [new branch] master -> rack_remote/master$ git checkout -b rack_branch rack_remote/masterBranch rack_branch set up to track remote branch refs/remote

    Switched to a new branch "rack_branch"$ lsAUTHORS!! KNOWN-ISSUES! Rakefile!contrib!! libCOPYING!! README! ! bin! ! example!! test

    $ lsREADME! ! rack_app.rb$ git remote add rack_remote [email protected]:schacon/rack.git$ git fetch rack_remotewarning: no common commitsremote: Counting objects: 3184 done

  • 8/14/2019 The GitHub Panel

    265/414

    remote: Counting objects: 3184, done.remote: Compressing objects: 100% (1465/1465), done.remote: Total 3184 (delta 1952), reused 2770 (delta 1675)Receiving objects: 100% (3184/3184), 677.42 KiB | 4 KiB/s, dResolving deltas: 100% (1952/1952), done.From [email protected]:schacon/rack* [new branch] master -> rack_remote/master$ git checkout -b rack_branch rack_remote/masterBranch rack_branch set up to track remote branch refs/remote

    Switched to a new branch "rack_branch"$ lsAUTHORS!! KNOWN-ISSUES! Rakefile!contrib!! libCOPYING!! README! ! bin! ! example!! test

    master

  • 8/14/2019 The GitHub Panel

    266/414

    C1

    C0

    C2

    C4

    rack_branch

    C5

    C6

    C3

    rack_remote/master

    $ git checkout master

  • 8/14/2019 The GitHub Panel

    267/414

    $ git checkout master$ lsREADME!! rack_app.rb$ git checkout rack_branch

    $ lsAUTHORS! ! KNOWN-ISSUES!Rakefile! contrib!! libCOPYING! ! README!! bin! ! example!! test

    $ git checkout master

  • 8/14/2019 The GitHub Panel

    268/414

    $ git checkout master$ lsREADME!! rack_app.rb$ git checkout rack_branch

    $ lsAUTHORS! ! KNOWN-ISSUES!Rakefile! contrib!! libCOPYING! ! README!! bin! ! example!! test

    $ git checkout master

  • 8/14/2019 The GitHub Panel

    269/414

    $ git checkout master$ lsREADME!! rack_app.rb$ git checkout rack_branch

    $ lsAUTHORS! ! KNOWN-ISSUES!Rakefile! contrib!! libCOPYING! ! README!! bin! ! example!! test

    $ git checkout master

  • 8/14/2019 The GitHub Panel

    270/414

    $ git checkout master$ lsREADME!! rack_app.rb$ git checkout rack_branch

    $ lsAUTHORS! ! KNOWN-ISSUES!Rakefile! contrib!! libCOPYING! ! README!! bin! ! example!! test

  • 8/14/2019 The GitHub Panel

    271/414

    checkout rack

    into my project

    $ git read-tree --prefix=rack/ -u rack_branch$ lsREADME!! rack!! rack_app.rb$ ls rackAUTHORS KNOWN ISSUES Rakefile contrib lib

  • 8/14/2019 The GitHub Panel

    272/414

    AUTHORS! ! KNOWN-ISSUES!Rakefile!contrib! ! libCOPYING! ! README!! bin! ! example! ! tes$ git add rack

    $ git commit -m 'added rack code'[master 0839fd8] added rack code108 files changed, 10334 insertions(+), 0 delcreate mode 100644 rack/AUTHORS

    create mode 100644 rack/COPYING...

    create mode 100644 rack/test/testrequest.rb

    $ git read-tree --prefix=rack/ -u rack_branch$ lsREADME!! rack!! rack_app.rb$ ls rackAUTHORS KNOWN ISSUES Rakefile contrib lib

  • 8/14/2019 The GitHub Panel

    273/414

    AUTHORS! ! KNOWN-ISSUES!Rakefile!contrib! ! libCOPYING! ! README!! bin! ! example! ! tes$ git add rack

    $ git commit -m 'added rack code'[master 0839fd8] added rack code108 files changed, 10334 insertions(+), 0 delcreate mode 100644 rack/AUTHORS

    create mode 100644 rack/COPYING...

    create mode 100644 rack/test/testrequest.rb

    $ git read-tree --prefix=rack/ -u rack_branch$ lsREADME!! rack!! rack_app.rb$ ls rackAUTHORS KNOWN ISSUES Rakefile contrib lib

  • 8/14/2019 The GitHub Panel

    274/414

    AUTHORS! ! KNOWN-ISSUES!Rakefile!contrib! ! libCOPYING! ! README!! bin! ! example! ! tes$ git add rack

    $ git commit -m 'added rack code'[master 0839fd8] added rack code108 files changed, 10334 insertions(+), 0 delcreate mode 100644 rack/AUTHORS

    create mode 100644 rack/COPYING...

    create mode 100644 rack/test/testrequest.rb

    $ git read-tree --prefix=rack/ -u rack_branch$ lsREADME!! rack!! rack_app.rb$ ls rackAUTHORS KNOWN-ISSUES Rakefile contrib lib

  • 8/14/2019 The GitHub Panel

    275/414

    AUTHORS! ! KNOWN-ISSUES!Rakefile!contrib! ! libCOPYING! ! README!! bin! ! example! ! tes$ git add rack

    $ git commit -m 'added rack code'[master 0839fd8] added rack code108 files changed, 10334 insertions(+), 0 delcreate mode 100644 rack/AUTHORS

    create mode 100644 rack/COPYING...

    create mode 100644 rack/test/testrequest.rb

    $ git read-tree --prefix=rack/ -u rack_branch$ lsREADME!! rack!! rack_app.rb$ ls rackAUTHORS KNOWN-ISSUES Rakefile contrib lib

  • 8/14/2019 The GitHub Panel

    276/414

    AUTHORS! ! KNOWN-ISSUES!Rakefile!contrib! ! libCOPYING! ! README!! bin! ! example! ! tes$ git add rack

    $ git commit -m 'added rack code'[master 0839fd8] added rack code108 files changed, 10334 insertions(+), 0 delcreate mode 100644 rack/AUTHORS

    create mode 100644 rack/COPYING...

    create mode 100644 rack/test/testrequest.rb

    $ git read-tree --prefix=rack/ -u rack_branch$ lsREADME!! rack!! rack_app.rb$ ls rackAUTHORS KNOWN-ISSUES Rakefile contrib lib

  • 8/14/2019 The GitHub Panel

    277/414

    AUTHORS! ! KNOWN-ISSUES!Rakefile!contrib! ! libCOPYING! ! README!! bin! ! example! ! tes$ git add rack

    $ git commit -m 'added rack code'[master 0839fd8] added rack code108 files changed, 10334 insertions(+), 0 delcreate mode 100644 rack/AUTHORS

    create mode 100644 rack/COPYING...

    create mode 100644 rack/test/testrequest.rb

  • 8/14/2019 The GitHub Panel

    278/414

    edit a file in rack

    $ vim rack/lib/rack.rb$ git commit -am 'added awesome to rack'

    [master b1b77ee] added awesome to rack

    1 files changed, 1 insertions(+), 0 deletions(-)

    $ git checkout rack branch

  • 8/14/2019 The GitHub Panel

    279/414

    $ git checkout rack_branch$ git merge --squash -s subtree --no-commit master

    Squash commit -- not updating HEAD

    Automatic merge went well; stopped before committi

    $ git status# On branch rack_branch# Changes to be committed:

    # (use "git reset HEAD ..." to unstage)

    ##! modified: lib/rack.rb#

    $ vim rack/lib/rack.rb$ git commit -am 'added awesome to rack'

    [master b1b77ee] added awesome to rack

    1 files changed, 1 insertions(+), 0 deletions(-)

    $ git checkout rack branch

  • 8/14/2019 The GitHub Panel

    280/414

    $ git checkout rack_branch$ git merge --squash -s subtree --no-commit master

    Squash commit -- not updating HEAD

    Automatic merge went well; stopped before committi

    $ git status# On branch rack_branch# Changes to be committed:

    # (use "git reset HEAD ..." to unstage)

    ##! modified: lib/rack.rb#

    $ vim rack/lib/rack.rb$ git commit -am 'added awesome to rack'

    [master b1b77ee] added awesome to rack

    1 files changed, 1 insertions(+), 0 deletions(-)

    $ git checkout rack branch

  • 8/14/2019 The GitHub Panel

    281/414

    $ git checkout rack_branch$ git merge --squash -s subtree --no-commit master

    Squash commit -- not updating HEAD

    Automatic merge went well; stopped before committi

    $ git status# On branch rack_branch# Changes to be committed:

    # (use "git reset HEAD ..." to unstage)

    ##! modified: lib/rack.rb#

  • 8/14/2019 The GitHub Panel

    282/414

    submit the change

    back to rack

    $ vim rack/lib/rack.rb$ git commit -am 'added awesome to rack'

    [master b1b77ee] added awesome to rack

    1 files changed, 1 insertions(+), 0 deletions(-)

    $ git checkout rack_branch$

  • 8/14/2019 The GitHub Panel

    283/414

    $ g _$ git merge --squash -s subtree --no-commit master

    Squash commit -- not updating HEAD

    Automatic merge went well; stopped before committi

    $ git status# On branch rack_branch# Changes to be committed:

    # (use "git reset HEAD ..." to unstage)

    ##! modified: lib/rack.rb#

  • 8/14/2019 The GitHub Panel

    284/414

    git merge -s subtree

    $ vim rack/lib/rack.rb$ git commit -am 'added awesome to rack'

    [master b1b77ee] added awesome to rack

    1 files changed, 1 insertions(+), 0 deletions(-)

    $ git checkout rack_branch$ i b i h

  • 8/14/2019 The GitHub Panel

    285/414

    g$ git merge -s subtree --no-commit --squash master

    Squash commit -- not updating HEAD

    Automatic merge went well; stopped before committi

    $ git status# On branch rack_branch# Changes to be committed:

    # (use "git reset HEAD ..." to unstage)

    ##! modified: lib/rack.rb#

    $ vim rack/lib/rack.rb$ git commit -am 'added awesome to rack'

    [master b1b77ee] added awesome to rack

    1 files changed, 1 insertions(+), 0 deletions(-)

    $ git checkout rack_branch$ i b i h

  • 8/14/2019 The GitHub Panel

    286/414

    g$ git merge -s subtree --no-commit --squash master

    Squash commit -- not updating HEAD

    Automatic merge went well; stopped before committi

    $ git status# On branch rack_branch# Changes to be committed:

    # (use "git reset HEAD ..." to unstage)

    ##! modified: lib/rack.rb#

    $ vim rack/lib/rack.rb$ git commit -am 'added awesome to rack'

    [master b1b77ee] added awesome to rack

    1 files changed, 1 insertions(+), 0 deletions(-)

    $ git checkout rack_branch$ it bt it h t

  • 8/14/2019 The GitHub Panel

    287/414

    g$ git merge -s subtree --no-commit --squash master

    Squash commit -- not updating HEAD

    Automatic merge went well; stopped before committi

    $ git status# On branch rack_branch# Changes to be committed:

    # (use "git reset HEAD ..." to unstage)

    ##! modified: lib/rack.rb#

    $ vim rack/lib/rack.rb$ git commit -am 'added awesome to rack'

    [master b1b77ee] added awesome to rack

    1 files changed, 1 insertions(+), 0 deletions(-)

    $ git checkout rack_branch$ it bt it h t

  • 8/14/2019 The GitHub Panel

    288/414

    g$ git merge -s subtree --no-commit --squash master

    Squash commit -- not updating HEAD

    Automatic merge went well; stopped before committi

    $ git status# On branch rack_branch# Changes to be committed:

    # (use "git reset HEAD ..." to unstage)

    ##! modified: lib/rack.rb#

    $ vim rack/lib/rack.rb$ git commit -am 'added awesome to rack'

    [master b1b77ee] added awesome to rack

    1 files changed, 1 insertions(+), 0 deletions(-)

    $ git checkout rack_branch$ it bt it h t

  • 8/14/2019 The GitHub Panel

    289/414

    g$ git merge -s subtree --no-commit --squash master

    Squash commit -- not updating HEAD

    Automatic merge went well; stopped before committi

    $ git status# On branch rack_branch# Changes to be committed:

    # (use "git reset HEAD ..." to unstage)

    ##! modified: lib/rack.rb#

    $ vim rack/lib/rack.rb$ git commit -am 'added awesome to rack'

    [master b1b77ee] added awesome to rack

    1 files changed, 1 insertions(+), 0 deletions(-)

    $ git checkout rack_branch$ it bt it h t

  • 8/14/2019 The GitHub Panel

    290/414

    g$ git merge -s subtree --no-commit --squash master

    Squash commit -- not updating HEAD

    Automatic merge went well; stopped before committi

    $ git status# On branch rack_branch# Changes to be committed:

    # (use "git reset HEAD ..." to unstage)

    ##! modified: lib/rack.rb#

    $ vim rack/lib/rack.rb$ git commit -am 'added awesome to rack'

    [master b1b77ee] added awesome to rack

    1 files changed, 1 insertions(+), 0 deletions(-)

    $ git checkout rack_branch$ it bt it h t

  • 8/14/2019 The GitHub Panel

    291/414

    g$ git merge -s subtree --no-commit --squash master

    Squash commit -- not updating HEAD

    Automatic merge went well; stopped before committi

    $ git status# On branch rack_branch# Changes to be committed:

    # (use "git reset HEAD ..." to unstage)

    ##! modified: lib/rack.rb#

    $ vim rack/lib/rack.rb$ git commit -am 'added awesome to rack'

    [master b1b77ee] added awesome to rack

    1 files changed, 1 insertions(+), 0 deletions(-)

    $ git checkout rack_branch$ git merge s s btree no commit sq ash master

  • 8/14/2019 The GitHub Panel

    292/414

    $ git merge -s subtree --no-commit --squash master

    Squash commit -- not updating HEAD

    Automatic merge went well; stopped before committi

    $ git status# On branch rack_branch# Changes to be committed:

    # (use "git reset HEAD ..." to unstage)

    ##! modified: lib/rack.rb#

    $ vim rack/lib/rack.rb$ git commit -am 'added awesome to rack'

    [master b1b77ee] added awesome to rack

    1 files changed, 1 insertions(+), 0 deletions(-)

    $ git checkout rack_branch$ git merge s subtree no commit squash master

  • 8/14/2019 The GitHub Panel

    293/414

    $ git merge -s subtree --no-commit --squash master

    Squash commit -- not updating HEAD

    Automatic merge went well; stopped before committi

    $ git status# On branch rack_branch# Changes to be committed:

    # (use "git reset HEAD ..." to unstage)

    ##! modified: lib/rack.rb#

  • 8/14/2019 The GitHub Panel

    294/414

  • 8/14/2019 The GitHub Panel

    295/414

    git merge -s subtree --no-commit --squash master

    really?

    Tim Dysinger

  • 8/14/2019 The GitHub Panel

    296/414

    http://dysinger.net/2008/04/29/

    replacing-braid-or-piston-for-git-with-40-lines-of-rake/

    y g

    Tim Dysinger

  • 8/14/2019 The GitHub Panel

    297/414

    http://dysinger.net/2008/04/29/

    replacing-braid-or-piston-for-git-with-40-lines-of-rake/

    http://tinyurl.com/braidgit

    y g

  • 8/14/2019 The GitHub Panel

    298/414

    Patch Staging

  • 8/14/2019 The GitHub Panel

    299/414

    git add -p

    $ git status

    # On branch master

    # Changed but not updated:

  • 8/14/2019 The GitHub Panel

    300/414

    # (use "git add ..." to update what wi# (use "git checkout -- ..." to disca

    ##!modified: ticgit.gemspec#

    no changes added to commit (use "git add" and

    $ git status

    # On branch master

    # Changed but not updated:

  • 8/14/2019 The GitHub Panel

    301/414

    # (use "git add ..." to update what wi# (use "git checkout -- ..." to disca

    ##!modified: ticgit.gemspec#

    no changes added to commit (use "git add" and

    $ git add -p

    diff --git a/ticgit.gemspec b/ticgit.gemspecindex 9c32bd4..a44667b 100644

    --- a/ticgit.gemspec

    +++ b/ticgit.gemspec

  • 8/14/2019 The GitHub Panel

    302/414

    @@ -1,7 +1,7 @@

    Gem::Specification.new do |s|

    s.platform = Gem::Platform::RUBY

    s.name = "ticgit"- s.version = "0.3.5"+ s.version = "0.3.6"

    s.date = "2008-05-10"s.author = "Scott Chacon"

    s.email = "[email protected]"Stage this hunk [y,n,a,d,/,j,J,g,e,?]? y

    $ git add -p

    diff --git a/ticgit.gemspec b/ticgit.gemspecindex 9c32bd4..a44667b 100644

    --- a/ticgit.gemspec

    +++ b/ticgit.gemspec

    @@ 1 7 1 7 @@

  • 8/14/2019 The GitHub Panel

    303/414

    @@ -1,7 +1,7 @@

    Gem::Specification.new do |s|

    s.platform = Gem::Platform::RUBY

    s.name = "ticgit"- s.version = "0.3.5"+ s.version = "0.3.6"

    s.date = "2008-05-10"s.author = "Scott Chacon"

    s.email = "[email protected]"Stage this hunk [y,n,a,d,/,j,J,g,e,?]? y

    $ git add -p

    diff --git a/ticgit.gemspec b/ticgit.gemspecindex 9c32bd4..a44667b 100644

    --- a/ticgit.gemspec

    +++ b/ticgit.gemspec

    @@ 1 7 1 7 @@

  • 8/14/2019 The GitHub Panel

    304/414

    @@ -1,7 +1,7 @@

    Gem::Specification.new do |s|

    s.platform = Gem::Platform::RUBY

    s.name = "ticgit"- s.version = "0.3.5"+ s.version = "0.3.6"

    s.date = "2008-05-10"s.author = "Scott Chacon"

    s.email = "[email protected]"Stage this hunk [y,n,a,d,/,j,J,g,e,?]?

    $ git add -p

    diff --git a/ticgit.gemspec b/ticgit.gemspecindex 9c32bd4..a44667b 100644

    --- a/ticgit.gemspec

    +++ b/ticgit.gemspec

    @@ 1 7 1 7 @@

  • 8/14/2019 The GitHub Panel

    305/414

    @@ -1,7 +1,7 @@

    Gem::Specification.new do |s|

    s.platform = Gem::Platform::RUBY

    s.name = "ticgit"- s.version = "0.3.5"+ s.version = "0.3.6"

    s.date = "2008-05-10"s.author = "Scott Chacon"

    s.email = "[email protected]"Stage this hunk [y,n,a,d,/,j,J,g,e,?]? y

    @@ -9,9 +9,10 @@ Gem::Specification.new do |s|s.files = ["lib/ticgit/base.rb", "lib/ticgit"lib/ticgit/comment.rb", "lib/ticgit/ticket.rb", "lib/

    ticgit.rb", "bin/ti", "bin/ticgitweb"]

    s.bindir = 'bin's executables

  • 8/14/2019 The GitHub Panel

    306/414

    - s.executables

  • 8/14/2019 The GitHub Panel

    307/414

    - s.executables

  • 8/14/2019 The GitHub Panel

    308/414

    - s.executables

  • 8/14/2019 The GitHub Panel

    309/414

    #

    #! modified: ticgit.gemspec#

    # Changed but not updated:# (use "git add ..." to update what will be co

    # (use "git checkout -- ..." to discard change#

    #! modified: ticgit.gemspec#

    $ git status

    # On branch master

    # Changes to be committed:

    # (use "git reset HEAD ..." to unstage)#

  • 8/14/2019 The GitHub Panel

    310/414

    #

    #! modified: ticgit.gemspec#

    # Changed but not updated:# (use "git add ..." to update what will be co

    # (use "git checkout -- ..." to discard change#

    #! modified: ticgit.gemspec#

  • 8/14/2019 The GitHub Panel

    311/414

    $ git status

    # On branch master

    # Changes to be committed:

    # (use "git reset HEAD ..." to unstage)#

  • 8/14/2019 The GitHub Panel

    312/414

    #

    #! modified: ticgit.gemspec#

    # Changed but not updated:# (use "git add ..." to update what will be co

    # (use "git checkout -- ..." to discard change#

    #! modified: ticgit.gemspec#

  • 8/14/2019 The GitHub Panel

    313/414

    partially stage files

  • 8/14/2019 The GitHub Panel

    314/414

    git add -p

  • 8/14/2019 The GitHub Panel

    315/414

    Debugging

  • 8/14/2019 The GitHub Panel

    316/414

    Annotation

  • 8/14/2019 The GitHub Panel

    317/414

    git blame

  • 8/14/2019 The GitHub Panel

    318/414

    git blameie: what dumbass did this? oh, it was me...

    git blame daemon.c979e32fa (Randal L. Schwartz 2005-10-25 16:29:09 -0700 1) #include "cache.h"

    85023577 (Junio C Hamano 2006-12-19 14:34:12 -0800 2) #include "pkt-line.h"77cb17e9 (Michal Ostrowski 2006-01-10 21:12:17 -0500 3) #include "exec_cmd.h"

    49ba83fb (Jon Loeliger 2006-09-19 20:31:51 -0500 4) #include "interpolate.h"f8ff0c06 (Petr Baudis 2005-09-22 11:25:28 +0200 5)

    85023577 (Junio C Hamano 2006-12-19 14:34:12 -0800 6) #include 85023577 (Junio C Hamano 2006-12-19 14:34:12 -0800 7)

    695dffe2 (Johannes Schindelin 2006-09-28 12:00:35 +0200 8) #ifndef HOST_NAME_MAX695dffe2 (Johannes Schindelin 2006-09-28 12:00:35 +0200 9) #define HOST NAME MAX 256

  • 8/14/2019 The GitHub Panel

    319/414

    695dffe2 (Johannes Schindelin 2006-09-28 12:00:35 +0200 9) #define HOST_NAME_MAX 256

    695dffe2 (Johannes Schindelin 2006-09-28 12:00:35 +0200 10) #endif695dffe2 (Johannes Schindelin 2006-09-28 12:00:35 +0200 11)

    415e7b87 (Patrick Welche 2007-10-18 18:17:39 +0100 12) #ifndef NI_MAXSERV415e7b87 (Patrick Welche 2007-10-18 18:17:39 +0100 13) #define NI_MAXSERV 32

    415e7b87 (Patrick Welche 2007-10-18 18:17:39 +0100 14) #endif415e7b87 (Patrick Welche 2007-10-18 18:17:39 +0100 15)

    9048fe1c (Petr Baudis 2005-09-24 16:13:01 +0200 16) static int log_syslog;f8ff0c06 (Petr Baudis 2005-09-22 11:25:28 +0200 17) static int verbose;

    1955fabf (Mark Wooding 2006-02-03 20:27:04 +0000 18) static int reuseaddr;f8ff0c06 (Petr Baudis 2005-09-22 11:25:28 +0200 19)

    960deccb (H. Peter Anvin 2005-10-19 14:27:01 -0700 20) static const char daemon_usage[] =1b1dd23f (Stephan Beyer 2008-07-13 15:36:15 +0200 21) "git daemon [--verbose] [--syslog] [

    3bd62c21 (Stephen R. van den Berg 2008-08-14 20:02:20 +0200 22) " [--timeout=n] [--init-ti3bd62c21 (Stephen R. van den Berg 2008-08-14 20:02:20 +0200 23) " [--strict-paths] [--base

    73a7a656 (Jens Axboe 2007-07-27 14:00:29 -0700 24) " [--user-path | --user-pa

    49ba83fb (Jon Loeliger 2006-09-19 20:31:51 -0500 25) " [--interpolated-path=pat678dac6b (Tilman Sauerbeck 2006-08-22 19:37:41 +0200 26) " [--reuseaddr] [--detach]d9edcbd6 (Junio C Hamano 2006-09-07 01:40:04 -0700 27) " [--[enable|disable|allow

    dd467629 (Jon Loeliger 2006-09-26 09:47:43 -0500 28) " [--inetd | [--listen=hosdd467629 (Jon Loeliger 2006-09-26 09:47:43 -0500 29) " [--user=user

    dd467629 (Jon Loeliger 2006-09-26 09:47:43 -0500 30) " [directory...]";4ae95682 (H. Peter Anvin 2005-09-26 19:10:55 -0700 31)

    4ae95682 (H. Peter Anvin 2005-09-26 19:10:55 -0700 32) /* List of acceptable pathname prefi96f1e58f David Rient es 2006-08-15 10:23:48 -0700 33 static char **ok aths

    git blame daemon.c979e32fa (Randal L. Schwartz 2005-10-25 16:29:09 -0700 1) #include "cache.h"

    85023577 (Junio C Hamano 2006-12-19 14:34:12 -0800 2) #include "pkt-line.h"77cb17e9 (Michal Ostrowski 2006-01-10 21:12:17 -0500 3) #include "exec_cmd.h"

    49ba83fb (Jon Loeliger 2006-09-19 20:31:51 -0500 4) #include "interpolate.h"f8ff0c06 (Petr Baudis 2005-09-22 11:25:28 +0200 5)

    85023577 (Junio C Hamano 2006-12-19 14:34:12 -0800 6) #include 85023577 (Junio C Hamano 2006-12-19 14:34:12 -0800 7)

    695dffe2 (Johannes Schindelin 2006-09-28 12:00:35 +0200 8) #ifndef HOST_NAME_MAX695dffe2 (Johannes Schindelin 2006-09-28 12:00:35 +0200 9) #define HOST NAME MAX 256

  • 8/14/2019 The GitHub Panel

    320/414

    695dffe2 (Johannes Schindelin 2006 09 28 12:00:35 +0200 9) #define HOST_NAME_MAX 256

    695dffe2 (Johannes Schindelin 2006-09-28 12:00:35 +0200 10) #endif695dffe2 (Johannes Schindelin 2006-09-28 12:00:35 +0200 11)

    415e7b87 (Patrick Welche 2007-10-18 18:17:39 +0100 12) #ifndef NI_MAXSERV415e7b87 (Patrick Welche 2007-10-18 18:17:39 +0100 13) #define NI_MAXSERV 32

    415e7b87 (Patrick Welche 2007-10-18 18:17:39 +0100 14) #endif415e7b87 (Patrick Welche 2007-10-18 18:17:39 +0100 15)

    9048fe1c (Petr Baudis 2005-09-24 16:13:01 +0200 16) static int log_syslog;f8ff0c06 (Petr Baudis 2005-09-22 11:25:28 +0200 17) static int verbose;

    1955fabf (Mark Wooding 2006-02-03 20:27:04 +0000 18) static int reuseaddr;f8ff0c06 (Petr Baudis 2005-09-22 11:25:28 +0200 19)

    960deccb (H. Peter Anvin 2005-10-19 14:27:01 -0700 20) static const char daemon_usage[] =1b1dd23f (Stephan Beyer 2008-07-13 15:36:15 +0200 21) "git daemon [--verbose] [--syslog] [

    3bd62c21 (Stephen R. van den Berg 2008-08-14 20:02:20 +0200 22) " [--timeout=n] [--init-ti3bd62c21 (Stephen R. van den Berg 2008-08-14 20:02:20 +0200 23) " [--strict-paths] [--base

    73a7a656 (Jens Axboe 2007-07-27 14:00:29 -0700 24) " [--user-path | --user-pa

    49ba83fb (Jon Loeliger 2006-09-19 20:31:51 -0500 25) " [--interpolated-path=pat678dac6b (Tilman Sauerbeck 2006-08-22 19:37:41 +0200 26) " [--reuseaddr] [--detach]d9edcbd6 (Junio C Hamano 2006-09-07 01:40:04 -0700 27) " [--[enable|disable|allow

    dd467629 (Jon Loeliger 2006-09-26 09:47:43 -0500 28) " [--inetd | [--listen=hosdd467629 (Jon Loeliger 2006-09-26 09:47:43 -0500 29) " [--user=user

    dd467629 (Jon Loeliger 2006-09-26 09:47:43 -0500 30) " [directory...]";4ae95682 (H. Peter Anvin 2005-09-26 19:10:55 -0700 31)

    4ae95682 (H. Peter Anvin 2005-09-26 19:10:55 -0700 32) /* List of acceptable pathname prefi96f1e58f David Rient es 2006-08-15 10:23:48 -0700 33 static char **ok aths

    git blame daemon.c979e32fa (Randal L. Schwartz 2005-10-25 16:29:09 -0700 1) #include "cache.h"

    85023577 (Junio C Hamano 2006-12-19 14:34:12 -0800 2) #include "pkt-line.h"77cb17e9 (Michal Ostrowski 2006-01-10 21:12:17 -0500 3) #include "exec_cmd.h"

    49ba83fb (Jon Loeliger 2006-09-19 20:31:51 -0500 4) #include "interpolate.h"f8ff0c06 (Petr Baudis 2005-09-22 11:25:28 +0200 5)

    85023577 (Junio C Hamano 2006-12-19 14:34:12 -0800 6) #include 85023577 (Junio C Hamano 2006-12-19 14:34:12 -0800 7)

    695dffe2 (Johannes Schindelin 2006-09-28 12:00:35 +0200 8) #ifndef HOST_NAME_MAX695dffe2 (Johannes Schindelin 2006-09-28 12:00:35 +0200 9) #define HOST NAME MAX 256

  • 8/14/2019 The GitHub Panel

    321/414

    695dffe2 (Johannes Schindelin 2006 09 28 12:00:35 +0200 9) #define HOST_NAME_MAX 256

    695dffe2 (Johannes Schindelin 2006-09-28 12:00:35 +0200 10) #endif695dffe2 (Johannes Schindelin 2006-09-28 12:00:35 +0200 11)

    415e7b87 (Patrick Welche 2007-10-18 18:17:39 +0100 12) #ifndef NI_MAXSERV415e7b87 (Patrick Welche 2007-10-18 18:17:39 +0100 13) #define NI_MAXSERV 32

    415e7b87 (Patrick Welche 2007-10-18 18:17:39 +0100 14) #endif415e7b87 (Patrick Welche 2007-10-18 18:17:39 +0100 15)

    9048fe1c (Petr Baudis 2005-09-24 16:13:01 +0200 16) static int log_syslog;f8ff0c06 (Petr Baudis 2005-09-22 11:25:28 +0200 17) static int verbose;

    1955fabf (Mark Wooding 2006-02-03 20:27:04 +0000 18) static int reuseaddr;f8ff0c06 (Petr Baudis 2005-09-22 11:25:28 +0200 19)

    960deccb (H. Peter Anvin 2005-10-19 14:27:01 -0700 20) static const char daemon_usage[] =1b1dd23f (Stephan Beyer 2008-07-13 15:36:15 +0200 21) "git daemon [--verbose] [--syslog] [

    3bd62c21 (Stephen R. van den Berg 2008-08-14 20:02:20 +0200 22) " [--timeout=n] [--init-ti3bd62c21 (Stephen R. van den Berg 2008-08-14 20:02:20 +0200 23) " [--strict-paths] [--base

    73a7a656 (Jens Axboe 2007-07-27 14:00:29 -0700 24) " [--user-path | --user-pa

    49ba83fb (Jon Loeliger 2006-09-19 20:31:51 -0500 25) " [--interpolated-path=pat678dac6b (Tilman Sauerbeck 2006-08-22 19:37:41 +0200 26) " [--reuseaddr] [--detach]d9edcbd6 (Junio C Hamano 2006-09-07 01:40:04 -0700 27) " [--[enable|disable|allow

    dd467629 (Jon Loeliger 2006-09-26 09:47:43 -0500 28) " [--inetd | [--listen=hosdd467629 (Jon Loeliger 2006-09-26 09:47:43 -0500 29) " [--user=user

    dd467629 (Jon Loeliger 2006-09-26 09:47:43 -0500 30) " [directory...]";4ae95682 (H. Peter Anvin 2005-09-26 19:10:55 -0700 31)

    4ae95682 (H. Peter Anvin 2005-09-26 19:10:55 -0700 32) /* List of acceptable pathname prefi96f1e58f David Rient es 2006-08-15 10:23:48 -0700 33 static char **ok aths

    979e32fa (Randal L. Schwartz 2005-10-25 16:29:09 -0700 1) #include "cache.h"

    85023577 (Junio C Hamano 2006-12-19 14:34:12 -0800 2) #include "pkt-line.h"77cb17e9 (Michal Ostrowski 2006-01-10 21:12:17 -0500 3) #include "exec_cmd.h"

    49ba83fb (Jon Loeliger 2006-09-19 20:31:51 -0500 4) #include "interpolate.h"f8ff0c06 (Petr Baudis 2005-09-22 11:25:28 +0200 5)

    85023577 (Junio C Hamano 2006-12-19 14:34:12 -0800 6) #include 85023577 (Junio C Hamano 2006-12-19 14:34:12 -0800 7)

    695dffe2 (Johannes Schindelin 2006-09-28 12:00:35 +0200 8) #ifndef HOST_NAME_MAX695dffe2 (Johannes Schindelin 2006-09-28 12:00:35 +0200 9) #define HOST NAME MAX 256

    git blame daemon.c

  • 8/14/2019 The GitHub Panel

    322/414

    695dffe2 (Johannes Schindelin 2006 09 28 12:00:35 +0200 9) #define HOST_NAME_MAX 256

    695dffe2 (Johannes Schindelin 2006-09-28 12:00:35 +0200 10) #endif695dffe2 (Johannes Schindelin 2006-09-28 12:00:35 +0200 11)

    415e7b87 (Patrick Welche 2007-10-18 18:17:39 +0100 12) #ifndef NI_MAXSERV415e7b87 (Patrick Welche 2007-10-18 18:17:39 +0100 13) #define NI_MAXSERV 32

    415e7b87 (Patrick Welche 2007-10-18 18:17:39 +0100 14) #endif415e7b87 (Patrick Welche 2007-10-18 18:17:39 +0100 15)

    9048fe1c (Petr Baudis 2005-09-24 16:13:01 +0200 16) static int log_syslog;f8ff0c06 (Petr Baudis 2005-09-22 11:25:28 +0200 17) static int verbose;

    1955fabf (Mark Wooding 2006-02-03 20:27:04 +0000 18) static int reuseaddr;f8ff0c06 (Petr Baudis 2005-09-22 11:25:28 +0200 19)

    960deccb (H. Peter Anvin 2005-10-19 14:27:01 -0700 20) static const char daemon_usage[] =1b1dd23f (Stephan Beyer 2008-07-13 15:36:15 +0200 21) "git daemon [--verbose] [--syslog] [

    3bd62c21 (Stephen R. van den Berg 2008-08-14 20:02:20 +0200 22) " [--timeout=n] [--init-ti3bd62c21 (Stephen R. van den Berg 2008-08-14 20:02:20 +0200 23) " [--strict-paths] [--base

    73a7a656 (Jens Axboe 2007-07-27 14:00:29 -0700 24) " [--user-path | --user-pa

    49ba83fb (Jon Loeliger 2006-09-19 20:31:51 -0500 25) " [--interpolated-path=pat678dac6b (Tilman Sauerbeck 2006-08-22 19:37:41 +0200 26) " [--reuseaddr] [--detach]d9edcbd6 (Junio C Hamano 2006-09-07 01:40:04 -0700 27) " [--[enable|disable|allow

    dd467629 (Jon Loeliger 2006-09-26 09:47:43 -0500 28) " [--inetd | [--listen=hosdd467629 (Jon Loeliger 2006-09-26 09:47:43 -0500 29) " [--user=user

    dd467629 (Jon Loeliger 2006-09-26 09:47:43 -0500 30) " [directory...]";4ae95682 (H. Peter Anvin 2005-09-26 19:10:55 -0700 31)

    4ae95682 (H. Peter Anvin 2005-09-26 19:10:55 -0700 32) /* List of acceptable pathname prefi96f1e58f David Rient es 2006-08-15 10:23:48 -0700 33 static char **ok aths

    979e32fa (Randal L. Schwartz 2005-10-25 16:29:09 -0700 1) #include "cache.h"

    85023577 (Junio C Hamano 2006-12-19 14:34:12 -0800 2) #include "pkt-line.h"77cb17e9 (Michal Ostrowski 2006-01-10 21:12:17 -0500 3) #include "exec_cmd.h"

    49ba83fb (Jon Loeliger 2006-09-19 20:31:51 -0500 4) #include "interpolate.h"f8ff0c06 (Petr Baudis 2005-09-22 11:25:28 +0200 5)

    85023577 (Junio C Hamano 2006-12-19 14:34:12 -0800 6) #include 85023577 (Junio C Hamano 2006-12-19 14:34:12 -0800 7)

    695dffe2 (Johannes Schindelin 2006-09-28 12:00:35 +0200 8) #ifndef HOST_NAME_MAX695dffe2 (Johannes Schindelin 2006-09-28 12:00:35 +0200 9) #define HOST NAME MAX 256

    git blame daemon.c

  • 8/14/2019 The GitHub Panel

    323/414

    695dffe2 (Johannes Schindelin 2006 09 28 12:00:35 +0200 9) #define HOST_NAME_MAX 256

    695dffe2 (Johannes Schindelin 2006-09-28 12:00:35 +0200 10) #endif695dffe2 (Johannes Schindelin 2006-09-28 12:00:35 +0200 11)

    415e7b87 (Patrick Welche 2007-10-18 18:17:39 +0100 12) #ifndef NI_MAXSERV415e7b87 (Patrick Welche 2007-10-18 18:17:39 +0100 13) #define NI_MAXSERV 32

    415e7b87 (Patrick Welche 2007-10-18 18:17:39 +0100 14) #endif415e7b87 (Patrick Welche 2007-10-18 18:17:39 +0100 15)

    9048fe1c (Petr Baudis 2005-09-24 16:13:01 +0200 16) static int log_syslog;f8ff0c06 (Petr Baudis 2005-09-22 11:25:28 +0200 17) static int verbose;

    1955fabf (Mark Wooding 2006-02-03 20:27:04 +0000 18) static int reuseaddr;f8ff0c06 (Petr Baudis 2005-09-22 11:25:28 +0200 19)

    960deccb (H. Peter Anvin 2005-10-19 14:27:01 -0700 20) static const char daemon_usage[] =1b1dd23f (Stephan Beyer 2008-07-13 15:36:15 +0200 21) "git daemon [--verbose] [--syslog] [

    3bd62c21 (Stephen R. van den Berg 2008-08-14 20:02:20 +0200 22) " [--timeout=n] [--init-ti3bd62c21 (Stephen R. van den Berg 2008-08-14 20:02:20 +0200 23) " [--strict-paths] [--base

    73a7a656 (Jens Axboe 2007-07-27 14:00:29 -0700 24) " [--user-path | --user-pa

    49ba83fb (Jon Loeliger 2006-09-19 20:31:51 -0500 25) " [--interpolated-path=pat678dac6b (Tilman Sauerbeck 2006-08-22 19:37:41 +0200 26) " [--reuseaddr] [--detach]d9edcbd6 (Junio C Hamano 2006-09-07 01:40:04 -0700 27) " [--[enable|disable|allow

    dd467629 (Jon Loeliger 2006-09-26 09:47:43 -0500 28) " [--inetd | [--listen=hosdd467629 (Jon Loeliger 2006-09-26 09:47:43 -0500 29) " [--user=user

    dd467629 (Jon Loeliger 2006-09-26 09:47:43 -0500 30) " [directory...]";4ae95682 (H. Peter Anvin 2005-09-26 19:10:55 -0700 31)

    4ae95682 (H. Peter Anvin 2005-09-26 19:10:55 -0700 32) /* List of acceptable pathname prefi96f1e58f David Rient es 2006-08-15 10:23:48 -0700 33 static char **ok aths

    979e32fa (Randal L. Schwartz 2005-10-25 16:29:09 -0700 1) #include "cache.h"

    85023577 (Junio C Hamano 2006-12-19 14:34:12 -0800 2) #include "pkt-line.h"77cb17e9 (Michal Ostrowski 2006-01-10 21:12:17 -0500 3) #include "exec_cmd.h"

    49ba83fb (Jon Loeliger 2006-09-19 20:31:51 -0500 4) #include "interpolate.h"f8ff0c06 (Petr Baudis 2005-09-22