La théorie des graphes appliquée à Git

88b8138397e1d1441f4e4a54348bde09?s=47 ubermuda
April 17, 2017

La théorie des graphes appliquée à Git

88b8138397e1d1441f4e4a54348bde09?s=128

ubermuda

April 17, 2017
Tweet

Transcript

  1. 4.
  2. 7.
  3. 8.
  4. 14.
  5. 18.

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

    depuis F Atteignabilité
  6. 20.
  7. 21.

    $ git branch * master $ ls .git/refs/heads/ master $

    cat .git/refs/heads/master 58bd01cded7904f1596cb12aac1d3e0e8ae6b558
  8. 27.
  9. 28.

    Rappel • Une branche • Un tag • HEAD :

    commit actuel à un instant T Références
  10. 29.
  11. 30.
  12. 31.

    A B D E C F master foo $ git

    merge master HEAD
  13. 32.

    A B D E C F master G foo $

    git merge master HEAD
  14. 33.

    A B D E C F master foo G foo

    $ git merge master HEAD
  15. 36.
  16. 37.

    A B C E D foo master F $ git

    merge foo Atteignable HEAD
  17. 38.

    C E D foo master F master A B $

    git merge foo HEAD
  18. 40.

    A B D E C F master foo $ git

    cherry-pick F HEAD
  19. 41.

    master foo F' A B D E C F foo

    $ git cherry-pick F HEAD
  20. 42.
  21. 43.
  22. 44.

    B merge base A D E C F master foo

    $ git rebase master HEAD
  23. 47.

    A B D E C F master foo C' $

    git rebase master HEAD
  24. 48.

    A B D E C F master foo C' D'

    $ git rebase master HEAD
  25. 49.

    A B D E C F master foo C' D'

    foo $ git rebase master HEAD
  26. 50.

    A B D E C F master C' D' foo

    $ git rebase master HEAD
  27. 51.

    A B D E C F master C' D' foo

    Headless $ git rebase master HEAD
  28. 53.

    A B D E C F master C' D' foo

    $ git reset --hard D foo A B D E C F C' D' HEAD
  29. 54.

    $ 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
  30. 55.
  31. 57.
  32. 58.

    A B C D master A B master C D

    origin/master origin origin/master local
  33. 59.
  34. 62.

    A B master A B master A B A B

    origin local C D D PAS ATTEIGNABLE
  35. 63.

    A B master A B master A B A B

    origin local C D D NOPE
  36. 64.