question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Option to disable auto-fetching (background fetching) in Desktop

See original GitHub issue

I would love the option to be able to turn off the app fetching the latest changes for me, or really any automatic git command done on my behalf. My main use case for the app is to have a pretty diff of the changes I’m about to commit. I do much of my other work, like resolving conflicts and updating a branch with the latest master, via the terminal. I often hit errors when I do a flow like git pull; git checkout master; git pull; git checkout -; git merge master that I think are caused by the app trying to run git commands at the same time I am:

Already up-to-date.
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.
error: cannot lock ref 'refs/remotes/origin/acceptance-saml': is at 00617906cd4ddf0ffdf2391f4c77187406a9b38a but expected 181445860d11aaeb13b0a281d42e59610e6499e2
From https://github.com/github/github
 ! 181445860d1..00617906cd4  acceptance-saml    -> origin/acceptance-saml  (unable to update local ref)
error: cannot lock ref 'refs/remotes/origin/lw-manage-listings': is at bde39ce0be0b9b4049a575892d705e440744068e but expected 38318bd501856d9f15119d7f6ef77f9a54427e89
 ! 38318bd5018..bde39ce0be0  lw-manage-listings -> origin/lw-manage-listings  (unable to update local ref)

I can get around these errors by rerunning my command, but it’s frustrating when they occur because it feels like I’m wrestling with the GitHub app being open. I’d like to be able to leave the app open since I commit frequently and love the diff view, but I’d also like to be in control of when it runs git commands.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:44
  • Comments:53 (22 by maintainers)

github_iconTop GitHub Comments

13reactions
niikcommented, Sep 29, 2020

Hi folks, I wanted to provide a quick update here. Yesterday we shipped GitHub Desktop 2.5.6 which included the ability to disable background refresh of all tracked repositories in the app. See https://github.com/desktop/desktop/pull/10593 for the technical details.

In addition to being able to disable, we’ve also made several performance improvements to the background updates (https://github.com/desktop/desktop/pull/10119, https://github.com/desktop/desktop/pull/10588).

I hope that this will provide some relief to those of you who have many repositories. I’ve opened https://github.com/desktop/desktop/issues/10687 to track the work of allowing disabling background fetch of the currently selected repository but the preliminary data we have suggests that the changes we made in #10593, #10119, and #10588 should have a significant impact especially for those of you who have many repositories tracked in the app.

This issue has expanded in scope significantly since it’s creation and covers both users with many repositories, enterprise scenarios, ssh remotes with automatic 2fa prompts, and more and it’s hard to get a good overview of the various use cases. As such I’m going to repurpose it to deal with the many-repositories scenario which I hope we’ve handled with #10593 and ask that those of you who’re looking to disable all types of background fetching head over to #10687 where we can focus solely on that issue. There’s also https://github.com/desktop/desktop/issues/3410 which tracks background software updates.

7reactions
cpcallencommented, May 14, 2020

As of GitHub Desktop 2.5.0 this has become totally intolerable.

I have git configured to use HTTPS for fetch and SSH for push, and ssh is configured (per corporate security policy) to require me to touch a physical security key for each new ssh connection.

From ~/.gitconfig:

[url "git@github.com:"]
        pushInsteadOf = "https://github.com/"

From .git/config:

[remote "origin"]
        url = https://github.com/google/CodeCity.git
        fetch = +refs/heads/*:refs/remotes/origin/*

Output of git remote -v, to verify this is configured as expected:

origin	https://github.com/google/CodeCity.git (fetch)
origin	git@github.com:google/CodeCity.git (push)

Previous to 2.5.0 I would only get prompted to authorise ssh only when pushing. Now I get prompted at random intervals, and no less than three times when launching Desktop. From ….desktop.production.log:

2020-05-14T14:04:21.715Z - info: [ui] launching: 2.5.0 (Mac OS 10.14.6)
2020-05-14T14:04:21.715Z - info: [ui] execPath: '/Applications/GitHub Desktop.app/Contents/Frameworks/GitHub Desktop Helper (Renderer).app/Contents/MacOS/GitHub Desktop Helper (Renderer)'
2020-05-14T14:04:23.754Z - info: [ui] [AppStore.withAuthenticatingUser] account found for repository: CodeCity - cpcallen (has token)
2020-05-14T14:04:23.783Z - info: [ui] Executing fetchTagsToPush: git -c credential.helper= -c protocol.version=2 push origin dumper --follow-tags --dry-run --porcelain (took 2.417s)
2020-05-14T14:04:24.347Z - info: [ui] [AppStore.withAuthenticatingUser] account found for repository: CodeCity - cpcallen (has token)
2020-05-14T14:04:24.357Z - info: [ui] Executing fetchTagsToPush: git -c credential.helper= -c protocol.version=2 push origin dumper --follow-tags --dry-run --porcelain (took 2.688s)
2020-05-14T14:04:25.497Z - info: [ui] [AppStore.withAuthenticatingUser] account found for repository: CodeCity - cpcallen (has token)
2020-05-14T14:04:25.525Z - info: [ui] Executing fetchTagsToPush: git -c credential.helper= -c protocol.version=2 push origin dumper --follow-tags --dry-run --porcelain (took 1.748s)
2020-05-14T14:05:00.241Z - info: [ui] [AppStore.withAuthenticatingUser] account found for repository: CodeCity - cpcallen (has token)

Since the unauthorised attempted push causes ssh to be invoked, I get interrupted by a modal dialog that steals focus from my editor. It appears that I will have to revert to a previous version of Desktop until this is resolved, because being interrupted at random every few minutes is unacceptable.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Disable Power Query background refresh - Microsoft Learn
In Power BI Desktop, you enable it by selecting File > Options and settings > Options, and then selecting the Data Load page....
Read more >
How to Disable Background Apps in Windows 11 - MakeUseOf
Fortunately, getting rid of resource-hungry background apps is ... Click the three-dots menu beside the app name and click Advanced options.
Read more >
How To Enable Or Disable Background Apps In Windows 10
You can stop Windows 10 apps from running in the background to save ... and fetch information to display up-to-date updates in their...
Read more >
Windows 11 Disable Background Apps
Prevent All Apps at Once from Running in the Background in Registry · Open the Registry editor; for that, press Win + R...
Read more >
What Is Superfetch and How Can You Disable It? - Avast
Turn off Superfetch in Windows 10 with services.msc · Right-click the Windows button in the lower-left corner of your desktop, then click Run....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found