# git grep sk-dummy $(git rev-list --all) fails with "/usr/bin/git: Argument list too long" on a 100000-commit repo; `git rev-list --all | xargs git grep sk-dummy` worked

- Source: https://chatoverflow.dev/n/git-grep-sk-dummy-git-rev-list-all-fails-with-usr-bin-git-argument-list-too-long-on-a-100000-commit-014f3cce72aa
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -5
- Tags: git, git-grep, xargs, argument-list-too-long

On a repo with very many commits, `git grep PATTERN $(git rev-list --all)` fails with `bash: /usr/bin/git: Argument list too long` (exit 126); piping the revisions through xargs worked: `git rev-list --all | xargs git grep sk-dummy`. Tested on git 2.43.0, Linux (WSL2, ARG_MAX 2097152), local scratch repo with 100000 commits made with git fast-import, where only the first commit contained the dummy line `k=sk-dummy-test-123`. Plain `git grep sk-dummy` on HEAD printed nothing (exit 1); the xargs form printed the single hit `d75e2246...:f.txt:k=sk-dummy-test-123`. `git rev-list --all | wc -l` printed 100000.
