Skip to content

Allow disabling background-fetching of the currently selected repository #10687

Open

Description

@niik

In #10593 we added the ability to disable the background updating of all tracked repositories in the app.

Even when disabling repository indicators we still perform background updating of the currently selected repository. As part of these background fetches we fast forward all but the currently selected branch which in turn powers "Update from default branch" and the merge/rebase dialogs as they operate on local branches only. It's also what enables us to show the ahead/behind indicator in the push/pull toolbar (and what enables us to detect that we need to do a pull vs a fetch).

image

In #7805 (comment) @cschreib-ibex describes one pain point of this approach and a potential solution.

Related to this: could "Update from MASTER" force a fetch before attempting to update/merge? At the moment, when a PR just gets merged on the github website, Github desktop doesn't realize straight away MASTER has new commits. Clicking "Update from MASTER" does nothing. I have to wait for it to do a background fetch, or force a fetch with git command line.

As a potential first step of this work we should investigate using the same logic as we do for repository indicators to avoid doing a fetch unless the API tells us that something has changed:

const lastPush = await inferLastPushForRepository(
this.accounts,
gitStore,
repository
)
if (await this.shouldBackgroundFetch(repository, lastPush)) {

That has the ability to significantly improve performance but the logic as it's written now is a bit shaky and would need to receive more scrutiny than what it did when it was added just for the repository indicators. We also need to audit what areas of the app rely directly or indirectly on our background fetching.

Activity

  1. raginpirate commented on Sep 13, 2021

    @raginpirate

    👋 Any updates on this issue?

    A few thoughts on this topic:

    • I think the UX on the disable option in settings is misleading. Usage of the term "all repositories" is not true when it is still fetching the current repository.
    • When working with VMs, it is incredibly annoying having my master branch get updated when my feature branch is behind as I swap between them. This forces me to either rebase or suffer from re-building my env. I have to work around this by creating a local "master-lock" branch which I periodically rebase from my remote.

    Thanks for the work you do on this project.

  2. awnumar commented on Oct 6, 2021

    @awnumar

    @raginpirate

    I think the UX on the disable option in settings is misleading. Usage of the term "all repositories" is not true when it is still fetching the current repository.

    I ran into this this in #13070 as well.

    +1 on this feature, the current behaviour is really surprising and interrupts my workflow. I've added context about my workflow here.

  3. jridgewell commented on Apr 21, 2022

    @jridgewell

    I have git set to use SSH connections to GH, and my SSH keys are stored in a Yubico security key. So, every five minutes, I get a pop up asking me to authenticate so that the app can fetch the current repo's state.

    It means I cannot keep the app open in the background, or it'll disturb my work constantly.

  4. jridgewell commented on Apr 22, 2022

    @jridgewell

    For anyone facing my Yubico key + SSH issue, you can force pulls to happen via HTTPS while forcing pushes to happen via SSH: https://stackoverflow.com/a/71971739/323767

  5. josh-panther commented on Jun 9, 2022

    @josh-panther

    I am also encountering the issue of the constantly blinking yubikey while Github desktop [mac] is open in the background, with no way to disable it besides closing the app.

  6. MichalStrehovsky commented on Feb 27, 2023

    @MichalStrehovsky

    Would it be possible to make this opt out? I often do work that requires me to do before/after comparisons and Github desktop updating the baseline keeps messing with what I'm doing (I then need to re-baseline everything because the baseline has changed when the app fast forwarded the branch that I switched back to for the baseline).

  7. pcantrell commented on Jan 17, 2024

    @pcantrell

    This is a tremendous headache for me as well, though not because of a Yubikey. My scenario:

    • I have ssh-based repos.
    • I use 1Password's ssh agent.
    • I have 1Password configured to lock itself after sleep or inactivity.

    The result? Every time I sit down to work, GitHub Desktop is blocked by a modal prompt to re-unlock 1Password — even if I'm only doing work that could be done entirely locally. I had a similar problem with the built-in ssh agent, but 1Password's (better! more secure!) option to lock after inactivity makes this a deal-killer for GitHub Desktop.

  8. Gunni commented on Feb 19, 2025

    @Gunni

    This bug was created in 2020, all we want is LESS, literally put a single IF before the code that performs the periodic refresh to return early... Or disable the timer that triggers it...

    EDIT:

    Oh look, i found it!

    Just update the label for the option

    Now just to add a condition for it...

    if (this.repositoryIndicatorsEnabled) {
    	this.startBackgroundFetching(repository, !previouslySelectedRepository)
    }
    

    Is that so hard?

  9. NickLai169 commented on Jun 16, 2025

    @NickLai169

    Given this is a 5-year-old ticket and @Gunni 's proposed solution but no such feature to disable auto-fetch exists in GH desktop, I'm presuming there is no intention to "fix" this issue?

    Or do we have a workaround, and I haven't quite managed to find it.

  10. plvaldes commented on Nov 20, 2025

    @plvaldes

    Are there any updates on this issue?

  11. abrambailey commented on Nov 27, 2025

    @abrambailey

    Hi, this is annoying me because I'm now using Secretive and getting auth requests regularly related to auto fetch... Please fix.

  12. Wiktorro commented on Dec 19, 2025

    @Wiktorro

    Hi, AAU of quickly developing large repo which slowly rebuilds, I also need to be able to disable auto fetch - when I switch between current work and local master, I prefer it to be same commit unless I fetch explicitly myself.
    Especially on the project I have currently open.
    This saves lots of time on local rebuilding project (with downloading binaries as well) multiple times, only my chances are impacting the build that way.
    Having such button as shown at top and working would be perfect.
    Short said , current fix in NOT TO USE GH client AT ALL

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