Gitting Things Done

Gitting Things Done

Presented on February 28 2020 at the Confoo conference, Montreal, Canada.
https://confoo.ca/en/yul2020/session/gitting-things-done
---------------------------------------------------------------
Git is the modern-day version management system of choice.
We all know how to commit, push, pull and merge. But what about (interactive) rebasing, fixing up commits, cherry picking lines and bisecting the history ?
And what are those atomic commits you keep hearing people talk about ?

Come and learn how to get the most out of the tooling you use every day and leave knowing how to create a clean commit history which is a joy to peruse.
---------------------------------------------------------------

2776198ea9584b6c0d4b494293b8d635?s=128

Juliette Reinders Folmer

February 28, 2020
Tweet

Transcript

  1. Gitting Things Done Juliette Reinders Folmer Tweet about it: @jrf_nl

    #Confoo20 Olivier Issaly
  2. What is Git ?

  3. About Forks & Remotes

  4. “ There is no one truth kconnors

  5. Original Repo Fork A Fork B

  6. Original Repo Fork A Fork B

  7. Original Repo Fork A Fork B

  8. Original Repo Fork A Fork B

  9. “ There is no limit to the amount of remotes

    you can add or that can exist
  10. Pull I accept your truth as my truth

  11. Push My truth is now your truth

  12. Pull Request Will you accept my truth as your truth

    ?
  13. Merging a PR Thanks for asking. I accept your truth

    as my truth
  14. About Branches Paul de Bruin

  15. Branches are your Save Points

  16. COPY/DEL TEMP PR WAIT-FOR WIP TODO Use Branches Liberally

  17. How to Write History and Get Your PRs Accepted

  18. Useful ?

  19. Decypherable ?

  20. Clean

  21. “ A clean history requires forethought and discipline kconnors

  22. Atomic Commits Pass CI Easy to Review Focus on One

    Thing Self-contained
  23. Atomic Commits === Story Telling

  24. Tools of The Trade  Interactive Rebase Maria Yan

  25. Rebase

  26. Rebase

  27. Interactive Rebase

  28. Interactive Rebase

  29. squash pick fixup drop edit reword Interactive Rebase

  30. None
  31. None
  32. None
  33. None
  34. None
  35. Squash vs Fixup  Combines changes into one commit 

    Combines the commit messages + presents for edit  Combines changes into one commit  Throws away all but the original commit message
  36. About Commit Messages  Short description (title)  Long description:

    Describe the why's  Reference links  Use proper punctuation! Voiculescu Bogdan
  37. Give Credit Where Credit is Due Prefix: description Long description

    explaining why the changes were made, why they were made in this way. What other option was considered and rejected and for what reason. Reference(s): • https://.... Co-authored-by: Contributor Name <email@address.net>
  38. Tools of The Trade  Interactive Rebase  Cherry picking

    Enrica Bressan
  39. Cherry Picking Commits Files Lines

  40. Cherry Picking When committing From other commits From other branches

  41. K.C. Hohensee

  42. To Force Push Or Not To Force Push DO: 

    Non- collaborative branch, not pulled  Pulled, rebased, no changes MAYBE  Pulled, typo/CS fix DON'T:  Collaborative branch, not pulled  Pulled, review has started
  43. When Things Go Wrong

  44. Reset vs Revert

  45. Reset vs Revert

  46. Reset vs Revert

  47. Reset vs Revert

  48. When Things Go Really Wrong

  49. Git Bisect to the Rescue Bad

  50. Git Bisect to the Rescue Bad Good

  51. Git Bisect to the Rescue Bad Good Good or Bad

    ?
  52. Git Bisect to the Rescue Bad Good Good or Bad

    ?
  53. Git Bisect to the Rescue Bad Good Good or Bad

    ? Good or Bad ?
  54. Git Bisect to the Rescue Bad Good Good or Bad

    ? Good or Bad ?
  55. Git Bisect to the Rescue Bad Good Good or Bad

    ? Good or Bad ? Good or Bad ?
  56. Git Bisect to the Rescue Bad Good Good or Bad

    ? Good or Bad ? Good or Bad ?
  57. Git Bisect to the Rescue Bad Good Good or Bad

    ? Good or Bad ? Good or Bad ?
  58. Keeping Your Codebase Clean Lisandra Barros Mendonça

  59. Commit vs Ignore In repo .gitignore .git/info/exclude Composer composer.json composer.lock

    /vendor/ composer.lock NPM package.json /node_modules/ package-lock.json PHPUnit phpunit.xml.dist phpunit.xml .phpunit.result.cache custom-phpunit.xml IDE of choice /.idea/ OS specific *.bak .Trashes [Tt]humbs.db *.DS_store
  60. Keep Distribution Packages Clean # Exclude these files from release

    archives. /.gitattributes export-ignore /.gitignore export-ignore /phpunit.xml.dist export-ignore /tests/ export-ignore # Auto detect text files and perform LF normalization * text=auto # The above will handle all files NOT found below *.md text .gitattributes
  61. Git in Comfort Git Kraken SmartGit Aurees SourceTree GitExtensions CLI

    GitEye Git Cola
  62. Thanks! Any questions ? Slides: https://speakerdeck.com/jrf Feedback: https://joind.in/talk/dafa1 @jrf_nl @jrfnl