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

La théorie des graphes appliquée à Git

ubermuda
April 17, 2017

La théorie des graphes appliquée à Git

ubermuda

April 17, 2017
Tweet

More Decks by ubermuda

Other Decks in Technology

Transcript

  1. A B D E C F D n'est pas atteignable

    depuis F Atteignabilité
  2. $ git branch * master $ ls .git/refs/heads/ master $

    cat .git/refs/heads/master 58bd01cded7904f1596cb12aac1d3e0e8ae6b558
  3. Rappel • Une branche • Un tag • HEAD :

    commit actuel à un instant T Références
  4. A B D E C F master foo $ git

    merge master HEAD
  5. A B D E C F master G foo $

    git merge master HEAD
  6. A B D E C F master foo G foo

    $ git merge master HEAD
  7. A B C E D foo master F $ git

    merge foo Atteignable HEAD
  8. C E D foo master F master A B $

    git merge foo HEAD
  9. A B D E C F master foo $ git

    cherry-pick F HEAD
  10. master foo F' A B D E C F foo

    $ git cherry-pick F HEAD
  11. B merge base A D E C F master foo

    $ git rebase master HEAD
  12. A B D E C F master foo C' $

    git rebase master HEAD
  13. A B D E C F master foo C' D'

    $ git rebase master HEAD
  14. A B D E C F master foo C' D'

    foo $ git rebase master HEAD
  15. A B D E C F master C' D' foo

    $ git rebase master HEAD
  16. A B D E C F master C' D' foo

    Headless $ git rebase master HEAD
  17. A B D E C F master C' D' foo

    $ git reset --hard D foo A B D E C F C' D' HEAD
  18. $ git reflog ... 384b39c HEAD@{10}: merge feature/bdl-auth: Fast-forward 84541fe

    HEAD@{11}: checkout: moving from feature/bdl-auth to 384b39c HEAD@{12}: rebase finished: returning to refs/heads/f 384b39c HEAD@{13}: rebase: Add auth bundle
  19. A B C D master A B master C D

    origin/master origin origin/master local
  20. A B master A B master A B A B

    origin local C D D PAS ATTEIGNABLE
  21. A B master A B master A B A B

    origin local C D D NOPE