Next.js starter your AI actually understands. Ship internal tools in days not weeks. Pre-order $199 $499 → [Get it now]

How to show Git diff

Viewing differences between files and commits is essential for understanding what changes have been made in your codebase. As the creator of CoreUI with over 25 years of development experience, I use git diff daily to review modifications before committing and to understand code evolution. The basic git diff command shows unstaged changes, providing a clear view of what has been modified in your working directory. This command is fundamental for code review and maintaining code quality in any project.

Use git diff to show unstaged changes in your working directory.

git diff

This command displays all modifications in your working directory that haven’t been staged yet. It shows line-by-line differences with + indicating added lines and - indicating removed lines. The output includes file names, line numbers, and the actual content changes, making it easy to review what has been modified before deciding whether to stage and commit the changes.

Best Practice Note:

This is the same workflow we use in CoreUI development to ensure code quality before commits. Use git diff --staged to review staged changes before committing, helping catch any unintended modifications.


Speed up your responsive apps and websites with fully-featured, ready-to-use open-source admin panel templates—free to use and built for efficiency.


About the Author

Subscribe to our newsletter
Get early information about new products, product updates and blog posts.
How to Use Bootstrap Dropdown in React the Right Way – with CoreUI
How to Use Bootstrap Dropdown in React the Right Way – with CoreUI

How to convert a string to boolean in JavaScript
How to convert a string to boolean in JavaScript

How to Clone an Object in JavaScript
How to Clone an Object in JavaScript

How to Achieve Perfectly Rounded Corners in CSS
How to Achieve Perfectly Rounded Corners in CSS

Answers by CoreUI Core Team