File tree 3 files changed +38
-0
lines changed
3 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -441,6 +441,44 @@ tradeoff. The main advantage is the generally linear commit history. This
441
441
greatly simplifies bisecting and makes the history and commit log much easier
442
442
to follow and understand.
443
443
444
+ ## Tips for reviewing
445
+
446
+ ** NOTE** : This section is for * reviewing* PRs, not authoring them.
447
+
448
+ ### Hiding whitespace
449
+
450
+ Github has a button for disabling whitespace changes that may be useful.
451
+ You can also use ` git diff -w origin/master ` to view changes locally.
452
+
453
+ ![ hide whitespace] ( ./img/github-whitespace-changes.png )
454
+
455
+ ### Fetching PRs
456
+
457
+ To checkout PRs locally, you can use `git fetch upstream pull/NNNNN/head && git checkout
458
+ FETCH_HEAD`.
459
+
460
+ You can also use github's cli tool. Github shows a button on PRs where you can copy-paste the
461
+ command to check it out locally. See < https://cli.github.com/ > for more info.
462
+
463
+ ![ ` gh ` suggestion] ( ./img/github-cli.png )
464
+
465
+ ### Moving large sections of code
466
+
467
+ Git and Github's default diff view for large moves * within* a file is quite poor; it will show each
468
+ line as deleted and each line as added, forcing you to compare each line yourself. Git has an option
469
+ to show moved lines in a different color:
470
+
471
+ ```
472
+ git log -p --color-moved=dimmed-zebra --color-moved-ws=allow-indentation-change
473
+ ```
474
+
475
+ See [ the docs for ` --color-moved ` ] ( https://git-scm.com/docs/git-diff#Documentation/git-diff.txt---color-movedltmodegt ) for more info.
476
+
477
+ ### range-diff
478
+
479
+ See [ the relevant section for PR authors] ( #git-range-diff ) . This can be useful for comparing code
480
+ that was force-pushed to make sure there are no unexpected changes.
481
+
444
482
## Git submodules
445
483
446
484
** NOTE** : submodules are a nice thing to know about, but it * isn't* an absolute
You can’t perform that action at this time.
0 commit comments