Skip to content

Fetch missing performance flags: --no-write-fetch-head, --write-commit-graph #22045

Open

Description

@coleleavitt

The problem

git fetch in Desktop doesn't use several available performance flags:

  1. --no-write-fetch-head: Desktop never reads FETCH_HEAD (it uses rev-parse and for-each-ref instead), but every fetch writes it — wasting an fsync per fetch.

  2. --write-commit-graph: The commit-graph file accelerates log traversal, merge-base computation, and reachability checks. Without it, these operations are O(n) per commit instead of O(1). Git supports incrementally building the commit-graph on fetch, but Desktop doesn't enable this.

  3. --no-auto-gc (WSL only): Post-fetch auto-gc triggers repacking which is extremely expensive across the 9P filesystem boundary on WSL repos.

Proposed solution

Add these flags to the fetch args in app/src/lib/git/fetch.ts:

'--no-write-fetch-head',
'--write-commit-graph',

And for WSL repos:

'--no-auto-gc',

Additional context

These flags are also beneficial to set during clone via git config:

  • core.fsmonitor=true — uses OS filesystem watcher instead of scanning the working tree (20-30% faster status on large repos)
  • core.untrackedCache=true — caches untracked file state in the index
  • fetch.writeCommitGraph=true — persisted so every future fetch builds the commit-graph

Implementation with tests in PR #22043.

Release version

3.5.8 (x64)

Operating system

Windows 11, macOS (all platforms benefit)

Activity

  1. github-actions commented on May 21, 2026

    @github-actions
    Contributor

    Thank you for your issue! We have categorized it as an enhancement (feature or improvement) request, and it has been added to our backlog. In doing so, we are not committing to implementing this feature at this time, but, we will consider it for future releases based on community feedback and our own product roadmap.

    Unless you see the help wanted Issues marked as ideal for external contributors label, we are not currently looking for external contributions for this feature.

    If you come across this issue and would like to see it implemented, please add a thumbs up! This will help us prioritize the feature. Please only comment if you have additional information or viewpoints to contribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions