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 get element ID in JavaScript
How to get element ID in JavaScript

How to compare dates with JavaScript
How to compare dates with JavaScript

How to Remove Elements from a JavaScript Array
How to Remove Elements from a JavaScript Array

How to sleep in Javascript
How to sleep in Javascript

Answers by CoreUI Core Team