may the git --force be with you · 2018-01-05 · # p, pick = use commit # r, reword = use commit,...

74
May the GIT --FORCE Be With You

Upload: others

Post on 13-Jul-2020

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash

May the GIT --FORCE Be With You

Page 2: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash

Mark Dorison @markdorison

Page 3: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash

My git log

Page 4: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash

Why are you here?

Page 5: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash

No Drupal Here

Page 6: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash

No Live Demos

Page 7: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash

You Must Learn the Ways of the GIT --FORCE

Page 8: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash
Page 9: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash

These Are the Commits You're Looking For

Page 10: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash

Commit Structure

Page 11: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash

nolan /v/w/d/outsideonline master git log 06dc921 commit 06dc921c67e4eb22ca1b4801d86cad5b42c434a5 Author: Mark Dorison <[email protected]> Date: Tue Feb 16 13:42:08 2016 -0500

Updated constant name for Longform Alt Article. Closes #2196.

Page 12: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash

Commit Messages

Page 13: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash

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.

Page 14: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash

http://bit.ly/chq-commit

Page 15: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash
Page 16: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash

All about pointers

Page 17: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash
Page 18: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash
Page 19: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash
Page 20: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash
Page 21: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash

Git Doesn’t Do Files

Page 22: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash

Git is distributed

Page 23: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash

Remotes

Page 24: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash

nolan /d/m/c/recurly 8.x-1.x git remote add origin [email protected]:ChromaticHQ/recurly.git

Page 25: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash
Page 26: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash
Page 27: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash

nolan /v/w/d/r/d/m/c/recurly 8.x-1.x git remote add origin [email protected]:ChromaticHQ/recurly.git

Page 28: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash
Page 29: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash

The Tools

Page 30: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash

nolan /v/w/d/o/docroot master git status

Page 31: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash

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

Page 32: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash

nolan /v/w/d/o/docroot master git co 979-image-optimize search: 97 979-image-optimize (Branch) acquia/979-imagemagick (Branch) origin/1397-timeline-articles (Branch) 979-imagemagick (Branch) acquia/1397-timeline-articles (Branch) origin/1976-native-video-hook (Branch) acquia/979-image-optimize (Branch) origin/979-image-optimize (Branch)

Page 33: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash

git blame

Page 34: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash

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, $html = FALSE) {

Page 35: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash

git cherry-pick

Page 36: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash
Page 37: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash

git reset

Page 38: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash
Page 39: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash

nolan /v/w/d/o/docroot master git reset HEAD^

Page 40: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash
Page 41: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash

git rebase

Page 42: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash

Traditional rebase

Page 43: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash
Page 44: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash
Page 45: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash

Reordering commits

Page 46: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash

git rebase --interactive

Page 47: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash

nolan /v/w/d/o/docroot master git rebase -i HEAD^^^

Page 48: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash

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

Page 49: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash

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

Page 50: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash

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

Page 51: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash

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

Page 52: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash

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

Page 53: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash

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

Page 54: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash

git commit --amend

Page 55: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash
Page 56: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash
Page 57: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash

git push --force

Page 58: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash

git bisect

Page 59: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash
Page 60: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash
Page 61: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash

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

Page 62: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash

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

Page 63: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash

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

Page 64: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash

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

Page 65: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash
Page 66: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash

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

Page 67: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash
Page 68: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash
Page 69: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash
Page 70: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash
Page 71: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash

nolan /v/w/d/outsideonline ➦ fd3fc7a git bisect good 06dc921c67e4eb22ca1b4801d86cad5b42c434a5 is the first bad commit commit 06dc921c67e4eb22ca1b4801d86cad5b42c434a5 Author: Mark Dorison <[email protected]> Date: Tue Feb 16 13:42:08 2016 -0500

Updated constant name for Longform Alt Article. Closes #2196.

Page 72: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash

nolan /v/w/d/outsideonline ➦ fd3fc7a git bisect good 06dc921c67e4eb22ca1b4801d86cad5b42c434a5 is the first bad commit commit 06dc921c67e4eb22ca1b4801d86cad5b42c434a5 Author: Mark Dorison <[email protected]> Date: Tue Feb 16 13:42:08 2016 -0500

Updated constant name for Longform Alt Article. Closes #2196.

Page 73: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash
Page 74: May the GIT --FORCE Be With You · 2018-01-05 · # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash

@ChromaticHQ