Question: How do I see all differences between production and my feature branch?
Try: git log --oneline --left-right --graph main...feature/new-api
Info: The three-dot ... notation compares the two branches from their common ancestor. --left-right marks commits unique to the left branch with < and commits unique to the right branch with >, making branch divergence easy to identify.
Examples:
- $
git log main..feature --oneline# Show commits reachable from feature but not main - $
git diff main...feature -- '*.js'# Show file changes introduced by the feature branch - $
git range-diff main..feature@{yesterday} main..feature# Compare changes between two versions of a branch
Note: Two dots (..) and three dots (...) have different meanings in Git. main..feature lists commits reachable from feature but not main, while main...feature uses the common ancestor when calculating the comparison. For a typical pull-request review, git diff main...feature shows the changes introduced by the feature branch since it diverged from main.
Leave a Reply