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?
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
Double-Dot (..) vs Triple-Dot (...) in Git
1. Double-Dot A..B
- Meaning: “Commits that are in
Bbut not inA” - 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
featurecompared tomain?”
Visual:
main: A---B---C
feature: E---F
main..feature -> E, F
2. Triple-Dot A...B
- Meaning: “Commits that are in
AorBbut 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
mainandfeature?”
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
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”
Similar Questions
Popular Questions
Newly Asked Questions
