Git Diff Command
Jump to navigation
Jump to search
A Git Diff Command is a version control command that displays code differences between git commits, working directorys, or staging areas.
- AKA: git diff, Git Difference Command, Git Change Display Command, Git Comparison Command.
- Context:
- It can typically compare Working Directory Changes against Staging Area.
- It can typically show Line Additions, Line Deletions, and Context Lines.
- It can typically generate Unified Diff Format or Context Diff Format output.
- It can often highlight Word-Level Changes within modified lines.
- It can often filter by File Path Patterns or File Types.
- It can often display File Permission Changes and File Mode Changes.
- It can support Binary File Comparison with summary information.
- It can range from being a Summary Diff Display to being a Detailed Diff Display, depending on its output verbosity.
- It can range from being a Colored Diff Output to being a Plain Diff Output, depending on its display format.
- It can range from being a File-Level Diff to being a Line-Level Diff, depending on its granularity level.
- It can range from being a Cached Diff to being a Working Tree Diff, depending on its comparison target.
- ...
- Examples:
- Basic Git Diff Usage, such as:
- `git diff` for working directory changes.
- `git diff --cached` for staged changes.
- Commit Comparison Usage, such as:
- `git diff HEAD~1` for last commit changes.
- `git diff branch1..branch2` for branch differences.
- Advanced Diff Usage, such as:
- `git diff --word-diff` for word-level change display.
- `git diff --stat` for change summary statistics.
- ...
- Basic Git Diff Usage, such as:
- Counter-Examples:
- Git Status Command, which lists modified files but doesn't show content differences.
- Git Log Command, which shows commit history but not detailed changes.
- Git Format-Patch Command, which creates patch files rather than displaying differences.
- See: Git Format-Patch Command, Git Apply Command, Version Control Command, Code Diff Algorithm, Diff Display Tool, Software Patch, Git Operation, Patch File Format, Version Control System.