Skip to content

Instantly share code, notes, and snippets.

View geoffreywiseman's full-sized avatar

Geoffrey Wiseman geoffreywiseman

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

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