git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[Bug] git fetch --dry-run --filter makes changes to .git/config

From
KPKevin Puetz <puetzkevina@johndeere.com>
Date
Sep 17, 2025, 14:44 UTC
Message-ID
<CY8PR05MB100119985C7C25A72E530556DB517A@CY8PR05MB10011.namprd05.prod.outlook.com>
What did you do before the bug happened? (Steps to reproduce your issue)
    `git fetch origin --refetch --dry-run {commit} --depth=1 --filter=tree:0 --no-auto-gc`
What did you expect to happen? (Expected behavior)
    I expected it to fetch just the one commit object (no blobs, no trees, no history),
    as a means of checking whether that commit is actually known to the remote.
What happened instead? (Actual behavior)
    the .git/config file was modified, adding
    [remote "origin"]
        promisor = true
        partialclonefilter = tree:0
What's different between what you expected and what actually happened?
    I did not expect any changes to the local clone (due to the use of --dry-run)
Anything else you want to add:
    Context is https://github.com/conan-io/conan/issues/18949
    trying to avoid a full-re-download in the process of checking
    whether the HEAD commit hash exists in a remote.
    The command was expected to either be a no-op success, or fail
    > fatal: remote error: upload-pack: not our ref {commit}"
[System Info]
git version:
git version 2.51.0.windows.1
cpu: x86_64
built from commit: 4d21a77b98af5cf479d8b6f863c2aa94257cd4e1
sizeof-long: 4
sizeof-size_t: 8
shell-path: D:/git-sdk-64-build-installers/usr/bin/sh
feature: fsmonitor--daemon
libcurl: 8.15.0
OpenSSL: OpenSSL 3.2.4 11 Feb 2025
zlib: 1.3.1
SHA-1: SHA1_DC
SHA-256: SHA256_BLK
default-ref-format: files
default-hash: sha1
uname: Windows 10.0 26100
compiler info: gnuc: 15.2
libc info: no libc information available
$SHELL (typically, interactive shell): C:\Program Files\Git\usr\bin\bash.exe
[Enabled Hooks]
Public
Next: brian m. carlson
Message 1 of 10 in “[Bug] git fetch --dry-run --filter makes changes to .git/config”
  1. Kevin PuetzSep 17, 2025
  2. brian m. carlsonSep 17, 2025
  3. Kevin PuetzSep 17, 2025
  4. Jeff KingSep 18, 2025
  5. Junio C HamanoSep 18, 2025
  6. Jeff KingSep 18, 2025
  7. Junio C HamanoSep 18, 2025
  8. Kevin PuetzSep 18, 2025
  9. rsbecker@nexbridge.comSep 18, 2025
  10. Kevin PuetzSep 19, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.