LogIn
I don't have account.

What are the differences between double-dot ".." and triple-dot "..." in Git commit ranges?

There are two valid commit ranges Syntax one is to separate two commit names with two dots .. and another syntax uses three dots ....

What are the differences between these two syntax?

Please pay attention to update your answer.

Update Your Answer care fully. After saving you can not recover your old answer

Carefully Update Your Answer!!

Double-Dot (..) vs Triple-Dot (...) in Git

1. Double-Dot A..B

  • Meaning: “Commits that are in B but not in A
  • Focus: Only the right-hand side branch
  • Equivalent to: git log ^A B

Example:

git log main..feature

  • Shows commits in feature that main doesn’t have
  • Good for: “What’s new in feature compared to main?”

Visual:

main:    A---B---C
feature:     E---F
main..feature -> E, F

2. Triple-Dot A...B

  • Meaning: “Commits that are in A or B but not in both” (symmetric difference)
  • Focus: Differences on both sides
  • Shows: Unique commits from both branches

Example:

git log main...feature

  • Shows commits that are only in main or only in feature
  • Good for: “What is different between main and feature?”

Visual:

main:    A---B---C
feature:     E---F
main...feature -> C, E, F
  • C (in main but not in feature), E and F (in feature but not in main)

Please pay attention to update your answer.

Update Your Answer care fully. After saving you can not recover your old answer

Carefully Update Your Answer!!

In short:

  • A..B (double-dot) : Shows commits in B but not in A (what’s new in B).
  • A...B (triple-dot) : Shows commits unique to A or B (differences between the two branches).

Tip:

  • .. : “new in right branch”
  • ... : “what’s different on both sides”