git fetch --dry-run can modify the repo
- From
- Tyler Breisacher <matrixfrog@gmail.com>
- Date
- Feb 10, 2026, 05:33 UTC
- Message-ID
- <CAGf4dO6QQ+ZG0iWqOY4StM-_UfmH2rZsBjFUcv0ziK5qvbkTHg@mail.gmail.com>
Interesting bug we came across -- or at least I think it's a bug. In any git repo that is not a shallow clone:
$ cat .git/shallow # "No such file or directory" $ git fetch --depth=1 --dry-run $ cat .git/shallow # Prints a git sha
I would think no command should make any changes to the local repo if --dry-run is passed.
Thanks!
Tyler