[Moscow.pm] git vs. SVN

Lars Dɪᴇᴄᴋᴏᴡ 迪拉斯 daxim на cpan.org
Ср Сен 22 03:20:22 PDT 2010


Я блицдокладывал на YAPC::EU 2008 о моё любимое особенности Gitа, движение по 
времени чтобы починить ошибки. ☺

На пример, я забыл передать некоторые файли, но позже замечаю.

    > git log --pretty=oneline
    cafecafe HEAD
    ⋮
    1337babe oops, new feature was missing some test files
    ⋮
    ⋮
    0fabcab0 (something different)
    deadbeef new feature blah
    bb00b1e5 (something)

Я хочу соединить deadbeef с 1337babe.

    > git rebase --interactive deadbeef^

В $EDITORе…

    pick bb00b1e5 (something)
    pick deadbeef new feature blah
    pick 0fabcab0 (something different)
    pick 00000001 (unimportant)
    pick 00000002 (unimportant)
    pick 00000003 (unimportant)
    pick 1337babe oops, new feature was missing some test files
    pick 00000004 (unimportant)
    pick 00000005 (unimportant)
    pick 00000006 (unimportant)
    pick cafecafe HEAD

    # Rebase bb00b1e5..cafecafe onto bb00b1e5
    #
    # Commands:
    #  p, pick = use commit
    #  r, reword = use commit, but edit the commit message
    #  e, edit = use commit, but stop for amending
    #  s, squash = use commit, but meld into previous commit
    #  f, fixup = like "squash", but discard this commit's log message
    #
    # If you remove a line here THAT COMMIT WILL BE LOST.
    # However, if you remove everything, the rebase will be aborted.
    #

… переставию так:

    pick bb00b1e5 (something)
    pick deadbeef new feature blah
    s 1337babe oops, new feature was missing some test files
    pick 0fabcab0 (something different)
    pick 00000001 (unimportant)
    pick 00000002 (unimportant)
    pick 00000003 (unimportant)
    pick 00000004 (unimportant)
    pick 00000005 (unimportant)
    pick 00000006 (unimportant)
    pick cafecafe HEAD

Сохранить, закрыть:

    Rebasing (n/m)
    [detached HEAD 1337beef] new feature blah (with tests)
     x files changed, y insertions(+), z deletions(-)
    Successfully rebased and updated refs/heads/master.

Действует!

    > git log --pretty=oneline
    faceface HEAD
    ⋮
    cabbfabb (something different)
    1337beef new feature blah (with tests)
    bb00b1e5 (something)

-- 
желаю вам все хороший праздник середины осени
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.pm.org/pipermail/moscow-pm/attachments/20100922/5af6a69f/attachment.bin>


Подробная информация о списке рассылки Moscow-pm