Articles


Useful Git Commands You Should Know


A collection of essential Git commands to streamline your version control workflow.

List all files (excluding node_modules and .next)

Get a tree-like view of your project structure without the clutter:

find . -not -path "./node_modules*" -not -path "./.next*" -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'



Condensed commit history

See your commit history in a compact one-line format:

git log --oneline



View all branches at a glance

List both local and remote branches in one command:

git branch -a



Inspect recent changes

See what files were modified in the last commit:

git show --name-only



Trace changes to a specific file

Find all commits that affected a particular file:

git log -- filename

Search across your codebase

Find text patterns in all tracked files:

git grep "pattern"



Quick status check

See your current branch and changes at any time:

git status



Detailed recent activity

View the last 5 commits with file change statistics:

git log -5 --stat



💡 Pro-tip: Add --graph to visualize branch history.