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

Post on 13-Jul-2020

5 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

May the GIT --FORCE Be With You

Mark Dorison @markdorison

My git log

Why are you here?

No Drupal Here

No Live Demos

You Must Learn the Ways of the GIT --FORCE

These Are the Commits You're Looking For

Commit Structure

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.

Commit Messages

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.

http://bit.ly/chq-commit

All about pointers

Git Doesn’t Do Files

Git is distributed

Remotes

nolan /d/m/c/recurly 8.x-1.x git remote add origin git@github.com:ChromaticHQ/recurly.git

nolan /v/w/d/r/d/m/c/recurly 8.x-1.x git remote add origin git@github.com:ChromaticHQ/recurly.git

The Tools

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

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

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)

git blame

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) {

git cherry-pick

git reset

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

git rebase

Traditional rebase

Reordering commits

git rebase --interactive

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

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

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

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

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

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

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

git commit --amend

git push --force

git bisect

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

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

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

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

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

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.

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.

@ChromaticHQ

top related