Vscode: Index file in Git repository constantly updating

Created on 1 Feb 2016  路  29Comments  路  Source: microsoft/vscode

Hi,

Ever since installing VS Code I seem to have a problem with Git/Dropbox.

Whenever I have a folder open in VS Code which is a git repository it seems to constantly update the index file and the FETCH_HEAD file. I don't mean every time I save a file, I mean every few seconds.

This causes a problem with Dropbox because I'm using it to sync files between my home and work computers. The notifications in the bottom right of my screen keep coming thick and fast and it's driving me crazy. Not to mention that Dropbox is constantly uploading files because it thinks they've changed.

Anyone else having this problem?

Version of VS Code: 0.10.6

*duplicate bug

Most helpful comment

Fixed, it stops when I close VSCode.

All 29 comments

VSCode spawns git for its git operations. Every now and then it spawns git status to know whether something has indeed changed. This touches the index, which modifies some files within the .git directory. This will likely not change in the near future.

Some information on how to effectively use Dropbox with git can be found one Google search away.

I know how to "effectively use Dropbox with git", thanks. Your answer sounded a bit condescending at the end there.

Dropbox with Git works fine for me. It works with Visual Studio and it works with Sublime text. The problem here is with VS Code, not my setup.

If this isn't going to be fixed any time soon then that's not a problem, I can just go back to using Sublime text, but I was trying to report a problem to help you guys, I wasn't expecting attitude in return.

Jon

@jon64digital Apologies, I didn't mean to come off condescending.

Don't you see the index and FETCH_HEAD files being touched when using git from the command line as well? Namely, when running git status?

How about when you run git fetch? Do those files change? If so, you can disable our automatic git fetch calls by changing the setting git.autofetch to false.

Hi Jo茫o,

I will try both of those when I am next using my laptop.

However, I don't think that is my problem. I suspect that those files will change when I use git from the command line, but I expect things to change when using git.

My problem is that this doesn't just happen when using git inside of VS Code, it happens all the time that VS Code is running, even when I am not touching the computer. I can sit back in my chair and watch it updating every few seconds without interacting with it. So VS Code is doing something in the background constantly that other code editors don't do which is touching the git Index and Fetch_head files.

I can't just un-sync these files from dropbox unfortunately, otherwise I assume the git repository would be out of sync between my laptop and work PC.

Alright, let's fix that then! :+1:

I'll keep an eye on this. Let me know if I can be of any help.

This may be premature, bit I think it may be fixed. I recently updated VScode and right now I have it open with dropbox on and I'm not getting constant notifications saying that those files have been changed.

That is strange, we didn't do anything to change this. Are you sure it's not a problem to you anymore?

That is very strange. I haven't changed anything on my PC in the last week except for updating VScode. Still no sign of it happening after 3 days on the new version.

Closing then. We can always reopen if it comes back. Thanks for the info.

Sorry, but it came back last night.

I'm not sure how I can help, other than to record a video of it? Not sure that would help though as it would only show you what I'm describing. Or I could try sending you copies of the index file?

I have tried taking two copies of the index file after it says it's been modified to see if it has actually been modified, but I can't even open it in VS code as it's a binary file.

And the fact that it didn't do it for a couple of days during which I had dropbox switched on is an absolute mystery. My PC in the office doesn't do it either. However I know it's VS Code doing it because it stops happening as soon as I switch VS Code off :(

I'm observing the same behaviour when running VS Code against a Dropbox folder managed via git.

I don't know if this can be classified as a bug in Code itself --it's as easy as not leaving VS Code running when you're at your other computer. But the behaviour is somewhat confusing.

Hi @pantulis

Not sure if we're experiencing the same thing as my other PC at work is hibernated when I experience this at home.

+1 I also have the same problem, but only on my home PC, which is Windows 10 ... if that helps!

Working around it by pausing Dropbox sync and [hopefully remembering to] turn it back on when I'm done ... which kinda defeats the point ;-)

Closing as a duplicate of #901.

Fix will come to:

  1. Disable auto status when application is not in foreground and,
  2. Provide setting (or checkbox in viewlet) to disable auto status altogether.

Hi,

I am facing the same issue both on my Ubuntu 14.04 and MacOS 10.12.3 using VSCode 1.10. Not sure if you guys fixed it or not.

I can still see that index file from Dropbox constantly updating and create conflict files, even if the VSCode is just running in the background.

Don't you see the index and FETCH_HEAD files being touched when using git from the command line as well? Namely, when running git status?

How about when you run git fetch? Do those files change? If so, you can disable our automatic git fetch calls by changing the setting git.autofetch to false.

The only way to make Git touch FETCH_HEAD is to make it fetch a specific branch on a specific remote, and Git will set FETCH_HEAD to that branch's tip. Under no reason VSCode should ever touch FETCH_HEAD itself, let alone overwrite it.

I filed #23153 about this.

This is still happening to me with Ubuntu 17.04 and Windows 10, running VSCode 1.12 :(

Same for me here on MacOS v1.13.1. Sometimes restarting VS Code helps. I haven't noticed this few months ago working on my projects. Now after I have returned from a short break, I see this all the time and it is annoying.

Dropbox history for index file is insane, it changes every few seconds and I'm not even touching the keyboard.
screen shot 2017-06-20 at 20 36 30

Fixed, it stops when I close VSCode.

This thread has been open for a long time. Luckily it stopped happening to me a while ago but unfortunately I have no idea why.

Yah, happening for me too 馃槩 Put my computer on "Do not disturb" to not get the Dropbox notifications constantly...

This just started occurring for me on OSX (10.12.6 Beta [16G12b)), VSCode 1.16.0, Dropbox v34.4.20.

Looks like it's touching .git/index every 6 seconds or so (unchanged lines removed):

$ while :; do sleep 1; ls -alhT index; done
-rw-r--r--@ 1 justin  staff   3.8K Sep 10 20:48:27 2017 index
-rw-r--r--@ 1 justin  staff   3.8K Sep 10 20:48:34 2017 index
-rw-r--r--@ 1 justin  staff   3.8K Sep 10 20:48:37 2017 index
-rw-r--r--@ 1 justin  staff   3.8K Sep 10 20:48:44 2017 index
-rw-r--r--@ 1 justin  staff   3.8K Sep 10 20:48:48 2017 index

This also just started happening for me also, On OSX 10.12.5 (16F73) / VS Code Version 1.16.1 / Dropbox v34.4.22

I have found a workaround.

I'm using Sublime Text instead until Microsoft fix it.

Honestly, I just turn off notifications in Dropbox and I forgot about this problem.

You might forgot about the problem, but your CPU and your laptop battery life are still aware of the problem. ;)

On High Sierra vanilla (10.13), Seafile Client 6.1.0, and VS Code 1.16.1 this issue(?) repeats, where a VS Code window editing a file will git fetch all git repositories in child directories. This causes a near constant stream of notifications of updated FETCH_HEADs in my sync client (seafile).

I use a question mark on the issue above, as are far as I can see, this is all expected behaviour: VS Code does auto-fetching, and sync clients, well, sync. A command line git fetch touches the FETCH_HEAD, so, if anything, it's an issue for git, not VS Code. Maybe VS Code could be updated to only auto fetch repositories that are directly opened in the editor, instead of all child directories (and if this is supposed to be the logic already, then we have a bug to fix).

If you're having this happen on your machine, consider either turning off notifications for your sync client (not really recommended), adding FETCH_HEAD to your sync client ignore filter (definitely not recommended), addressing which files you have open in VS Code and your directory structure (too much effort for me), or do as I did and disable the auto fetch feature using "git.autofetch": false in your settings.

I was seeing a similar problem -- Index constantly changing -- however I was using Atom editor, not VSCode. I finally fixed the problem by ensuring that all of my machines were using the same version of Git (I had three machines that were all on different versions). Now they are all on git 2.14.2 and the problem has disappeared. Just my 2 cents...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jsftw86 picture jsftw86  路  361Comments

filfat picture filfat  路  246Comments

Tekbr picture Tekbr  路  191Comments

jez9999 picture jez9999  路  234Comments

TurkeyMan picture TurkeyMan  路  411Comments