Option to disable auto-fetching (background fetching) in Desktop
See original GitHub issueI 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:
- Created 6 years ago
- Reactions:44
- Comments:53 (22 by maintainers)
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.
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
:From
.git/config
:Output of
git remote -v
, to verify this is configured as expected: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
: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.