Skip to content

Instantly share code, notes, and snippets.

@todgru
Created September 24, 2024 20:36
Show Gist options
  • Save todgru/c52fad90c79fc7ffec67d814b16ddb6f to your computer and use it in GitHub Desktop.
Save todgru/c52fad90c79fc7ffec67d814b16ddb6f to your computer and use it in GitHub Desktop.
git diff vs github pr diff

Git diff: double dots vs tripple dots

  • double dots: simple diff
  • tripple dots: common ancestor diff

Examples

Use double dots (..) to show changes in the feature branch that are not in the parent.

git diff feature..main

Use triple dots (...) to show all the changes beginning at the common ancestor of the feature branch and the parent. Pull requests on GitHub show a three-dot diff.

git diff feature...main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment