May the GIT --FORCE Be With You

May the GIT --FORCE Be With You

An advanced git master class.

06d59b7a09c0085d85d0a42638e0db01?s=128

Mark Dorison

February 26, 2016
Tweet

Transcript

  1. May the GIT --FORCE Be With You

  2. Mark Dorison @markdorison

  3. My git log

  4. Why are you here?

  5. No Drupal Here

  6. No Live Demos

  7. You Must Learn the Ways of the GIT --FORCE

  8. None
  9. These Are the Commits You're Looking For

  10. Commit Structure

  11. nolan  /v/w/d/outsideonline   master  git log 06dc921

    
 commit 06dc921c67e4eb22ca1b4801d86cad5b42c434a5 Author: Mark Dorison <mark@chromatichq.com> Date: Tue Feb 16 13:42:08 2016 -0500 Updated constant name for Longform Alt Article. 
 
 Closes #2196.
  12. Commit Messages

  13. Capitalized, short (50 chars or less) summary. More detailed explanatory

    text, if necessary. Wrap it to about 72 characters or so. In some contexts, the first line is treated as the subject of an email and the rest of the text as the body. The blank line separating the summary from the body is critical (unless you omit the body entirely); tools like rebase can get confused if you run the two together. Further paragraphs come after blank lines. * Bullet points are okay, too. * Typically a hyphen or asterisk is used for the bullet, preceded by a single space, with blank lines in between, but conventions vary here. * Use a hanging indent. Closes gh-80.
  14. http://bit.ly/chq-commit

  15. None
  16. All about pointers

  17. None
  18. None
  19. None
  20. None
  21. Git Doesn’t Do Files

  22. Git is distributed

  23. Remotes

  24. nolan  /d/m/c/recurly   8.x-1.x  git remote add

    origin git@github.com:ChromaticHQ/recurly.git
  25. None
  26. None
  27. nolan  /v/w/d/r/d/m/c/recurly   8.x-1.x  git remote add

    origin git@github.com:ChromaticHQ/recurly.git
  28. None
  29. The Tools

  30. nolan  /v/w/d/o/docroot   master  git status

  31. nolan  /v/w/d/o/docroot   master  git co 669-package-redirects

    538-bundle-fix (Branch) acquia/buyers-guide-article-set 669-package-redirects (Branch) acquia/buyers-guide-setup 979-image-optimize (Branch) acquia/buyers-guide-swath 979-imagemagick (Branch) acquia/contained-stacks-updates …and 112 more rows
  32. nolan  /v/w/d/o/docroot   master  git co 979-image-optimize

    search: 97 979-image-optimize (Branch) acquia/979-imagemagick (Branch) origin/1 979-imagemagick (Branch) acquia/1397-timeline-articles (Branch) origin/1 acquia/979-image-optimize (Branch) origin/979-image-optimize (Branch)
  33. git blame

  34. 9a2820e3 (Nathan Haug 2014-07-08 18:39:35 -0700 796) /** 9a2820e3 (Nathan

    Haug 2014-07-08 18:39:35 -0700 797) * Format a Recurly coupon in a human-readable string. 9a2820e3 (Nathan Haug 2014-07-08 18:39:35 -0700 798) * 7c67baa0 (Mark Dorison 2015-12-23 02:37:18 +0000 799) * @param \Recurly_Coupon $coupon 9a2820e3 (Nathan Haug 2014-07-08 18:39:35 -0700 800) * The Recurly coupon object being formatted for display. 9a2820e3 (Nathan Haug 2014-07-08 18:39:35 -0700 801) * @param string $currency 9a2820e3 (Nathan Haug 2014-07-08 18:39:35 -0700 802) * The currency code in which the coupon is being redeemed. b435ebc1 (Alanna Burke 2015-11-12 14:43:29 -0800 803) * @param bool $html 9a2820e3 (Nathan Haug 2014-07-08 18:39:35 -0700 804) * Whether to return the formatted string with wrapping HTML or not b435ebc1 (Alanna Burke 2015-11-12 14:43:29 -0800 805) * 9a2820e3 (Nathan Haug 2014-07-08 18:39:35 -0700 806) * @return string 9a2820e3 (Nathan Haug 2014-07-08 18:39:35 -0700 807) * The formatted string ready for printing. 9a2820e3 (Nathan Haug 2014-07-08 18:39:35 -0700 808) */ 7c67baa0 (Mark Dorison 2015-12-23 02:37:18 +0000 809) function recurly_format_coupon(\Recurly_Coupon $coupon, $currency, $h
  35. git cherry-pick

  36. None
  37. git reset

  38. None
  39. nolan  /v/w/d/o/docroot   master  git reset HEAD^

  40. None
  41. git rebase

  42. Traditional rebase

  43. None
  44. None
  45. Reordering commits

  46. git rebase --interactive

  47. nolan  /v/w/d/o/docroot   master  git rebase -i

    HEAD^^^
  48.  nolan  /v/w/d/outsideonline   master  git rebase

    -i HEAD^^^
 pick 6455359 Add watermark image upload, dependent on Longform Alt pick 0f04bf0 Fix for interstitials on main image slideshows pick b32522d Complete functionality for outside_blog_migration # Rebase d7340fe..9704a9b onto d7340fe (3 command(s)) # # 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 # x, exec = run command (the rest of the line) using shell # d, drop = remove commit
  49.  nolan  /v/w/d/outsideonline   master  git rebase

    -i HEAD^^^
 pick 6455359 Add watermark image upload, dependent on Longform Alt pick 0f04bf0 Fix for interstitials on main image slideshows pick b32522d Complete functionality for outside_blog_migration # Rebase d7340fe..9704a9b onto d7340fe (3 command(s)) # # 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 # x, exec = run command (the rest of the line) using shell # d, drop = remove commit
  50.  nolan  /v/w/d/outsideonline   master  git rebase

    -i HEAD^^^
 pick 6455359 Add watermark image upload, dependent on Longform Alt pick 0f04bf0 Fix for interstitials on main image slideshows pick b32522d Complete functionality for outside_blog_migration # Rebase d7340fe..9704a9b onto d7340fe (3 command(s)) # # 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 # x, exec = run command (the rest of the line) using shell # d, drop = remove commit
  51.  nolan  /v/w/d/outsideonline   master  git rebase

    -i HEAD^^^
 pick 6455359 Add watermark image upload, dependent on Longform Alt pick 0f04bf0 Fix for interstitials on main image slideshows pick b32522d Complete functionality for outside_blog_migration # Rebase d7340fe..9704a9b onto d7340fe (3 command(s)) # # 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 # x, exec = run command (the rest of the line) using shell # d, drop = remove commit
  52.  nolan  /v/w/d/outsideonline   master  git rebase

    -i HEAD^^^
 pick 6455359 Add watermark image upload, dependent on Longform Alt pick 0f04bf0 Fix for interstitials on main image slideshows pick b32522d Complete functionality for outside_blog_migration # Rebase d7340fe..9704a9b onto d7340fe (3 command(s)) # # 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 # x, exec = run command (the rest of the line) using shell # d, drop = remove commit
  53.  nolan  /v/w/d/outsideonline   master  git rebase

    -i HEAD^^^
 r 6455359 Add watermark image upload, dependent on Longform Alt s 0f04bf0 Fix for interstitials on main image slideshows pick b32522d Complete functionality for outside_blog_migration # Rebase d7340fe..9704a9b onto d7340fe (3 command(s)) # # 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 # x, exec = run command (the rest of the line) using shell # d, drop = remove commit
  54. git commit --amend

  55. None
  56. None
  57. git push --force

  58. git bisect

  59. None
  60. None
  61. nolan  /v/w/d/outsideonline   master  git bisect start

    nolan  /v/w/d/outsideonline   master  git bisect bad nolan  /v/w/d/outsideonline   master  git co 1849-culture-analytics Switched to branch '1849-culture-analytics' Your branch is up-to-date with 'origin/1849-culture-analytics'. nolan  /v/w/d/outsideonline   1849-culture-analytics  git bisect good
  62. nolan  /v/w/d/outsideonline   master  git bisect start

    nolan  /v/w/d/outsideonline   master  git bisect bad nolan  /v/w/d/outsideonline   master  git co 1849-culture-analytics Switched to branch '1849-culture-analytics' Your branch is up-to-date with 'origin/1849-culture-analytics'. nolan  /v/w/d/outsideonline   1849-culture-analytics  git bisect good
  63. nolan  /v/w/d/outsideonline   1849-culture-analytics  git bisect good

    Bisecting: 125 revisions left to test after this (roughly 7 steps) [f7cba3d4215e95bc0af418cdcdc3934d0f9a4f9f] Merge pull request #2161 nolan  /v/w/d/outsideonline  ➦ f7cba3d 
  64. nolan  /v/w/d/outsideonline   1849-culture-analytics  git bisect good

    Bisecting: 125 revisions left to test after this (roughly 7 steps) [f7cba3d4215e95bc0af418cdcdc3934d0f9a4f9f] Merge pull request #2161 nolan  /v/w/d/outsideonline  ➦ f7cba3d 
  65. None
  66. nolan  /v/w/d/outsideonline  ➦ f7cba3d  git bisect good

    Bisecting: 62 revisions left to test after this (roughly 6 steps) [63b2a2a0d7a65c786cbf83036a964ef160522f41] Updates to main image/video
  67. None
  68. None
  69. None
  70. None
  71. nolan  /v/w/d/outsideonline  ➦ fd3fc7a  git bisect good

    06dc921c67e4eb22ca1b4801d86cad5b42c434a5 is the first bad commit commit 06dc921c67e4eb22ca1b4801d86cad5b42c434a5 Author: Mark Dorison <mark@chromatichq.com> Date: Tue Feb 16 13:42:08 2016 -0500 Updated constant name for Longform Alt Article. 
 
 Closes #2196.
  72. nolan  /v/w/d/outsideonline  ➦ fd3fc7a  git bisect good

    06dc921c67e4eb22ca1b4801d86cad5b42c434a5 is the first bad commit commit 06dc921c67e4eb22ca1b4801d86cad5b42c434a5 Author: Mark Dorison <mark@chromatichq.com> Date: Tue Feb 16 13:42:08 2016 -0500 Updated constant name for Longform Alt Article. 
 
 Closes #2196.
  73. None
  74. @ChromaticHQ