Skip to content

Instantly share code, notes, and snippets.

Avatar

Geoffrey Wiseman geoffreywiseman

View GitHub Profile
@sindresorhus
sindresorhus / git-dirty-checks.md
Created Oct 16, 2012
Benchmark results of the fastest way to check if a git branch is dirty
View git-dirty-checks.md

Tested against the WebKit git repo by entering the repo with 1 file dirty.


git diff --quiet --ignore-submodules HEAD # Will tell if there are any uncomitted changes, staged or not.
0.6 sec

git diff-index --quiet HEAD # Only tracked
2 sec

You can’t perform that action at this time.