How can I compare a Git tag with the current working tree?
Quick answer
Run git diff TAG, replacing TAG with the tag you want to inspect—for example, git diff v1.0. This compares that tagged commit with your current working tree; you do not need to check out the tag. Read the direction as changes from the tag to your working tree. To reverse the diff direction, use git diff -R TAG. [S1]
The question, the details, the next step.
A practical checklist
Choose the tag that represents the version you want as your baseline.
Use
git diff TAGto compare that tag with your current working tree.Read the direction explicitly: the tag is compared with the working tree.
Use
git diff -R TAGwhen you want the reverse diff direction.Treat the output as differences to review, not an explanation of why they exist.
A few more useful answers
Will `git diff TAG` check out the tag or move my branch?
No checkout is needed for this comparison. The documented diff form compares a tag’s commit with the working tree without requiring you to check out the tag. [S1]
How do I reverse the comparison direction?
Use git diff -R TAG to reverse the diff direction. Check the direction before interpreting which endpoint a displayed change represents. [S1]
Does the diff explain whether a change is good or intentional?
No. It shows differences between the selected endpoints; deciding why a change exists or whether it is appropriate requires reviewing it in context.
Sources
References used for this guide.
- [S1] Git - git-diff Documentation git-scm.com · Checked
