简体   繁体   中英

Git changes not showing in VS2013 Update 2

I am using Git in VS2013 and my changed files are not showing up in the Changes window of VS.

When I have changed a file but before I have saved it to disk it does show up. But as soon as I save the file to disk the change disappears from the Changes window.

I tried uninstalling and reinstalling VS2013 but it did not help. Any ideas on how to keep the changes in the window once they are saved?

I have been using Git on the command line to work around this issue so that git client is able to detect that there are changes.

Before save.

在此处输入图片说明

After saving file change disappears.

在此处输入图片说明

I had this problem too. It happened randomly, and sooner or later my git status was completely erased from Microsoft Git Provider add-in in Visual Studio, although it was correct on Git bash.

Turns out that, in my case, it would happen as soon as I open a connection to a LocalDb database from SQL Management Studio, and kept the connection open. So, I suspect this might happens whenever a process locks out a file which is monitored by Microsoft Git Provider.

Hope it helps. In my case, it's fixed!

I had the Roslyn preview extension installed. Disabling this extension fixes the issue.

even if it's quite old question, I've got a similar problem last week on VS2013 and none of previews workarounds are efficents for me. While editing a file, it's appear on Team Explorer list of modify files but, as soon as they are saved, they disaperead from any lists. Other tools (git bash, tortoise, ...) saw them as modify and uncommit but not VS. I solutionne this problem in the parameter of Git in Team Explorer by generating the .gitIgnore file of the solution ! I hope this could help.

使用 Editor 或 Notepad++ 打开.gitignore文件,然后删除包含要跟踪的文件的行。

I came across this issue when adding a new but existing project to my solution in VS2015. The problem was that the new project used a local db file (an .sdf as well as an opendb) that got added to the root of the solution. When trying to stage uncommitted changes, it was failing because it couldn't access the opendb file while vs had a hold of it.

I found this out by using git for windows and trying to stage my changes. Once I added the *opendb to my .gitignore and reopened Visual Studio, it found all my other changes.

I had this same problem and it was happening because all the code files were in a subfolder which also contained a git repository and that was preventing it from staying in the "included changes" section after saving.

To fix it I went into the subfolder and changed all the names of the git files to something else (ex. renamed .git folder to z.git, .gitingore to z.gitingorez, ect). After that all the files showed up in the "untracked files" section and the changes stayed in the "included changes" section after saving.

I'm using Visual Studio 2017, but I had to EXACT same problem. Took me hours to actually figure out a solution.

Solution:

  1. Find your .git folder .
  2. Locate and delete the 'index.lock' file.
  3. Restart Visual Studio.

I hope this helps someone!

Simple solution:

1) Close VS 2013 and manually rename the solution's folder. 2) Reopen VS 2013. VS will prompt you to clone the solution from the server in order to open it. Follow the prompts and clone a new copy of the solution. 3) Close VS 2013 and use Beyond Compare (or some other file compare system) to manually move your changes from the old solution to the new solution. 4) Reopen VS 2013. Your changes will show up and you can commit them to the local and remote repository.

---More information---

Had the same problem. Made a change to a file in VS 2013 Update 4. Before saving the file, the changed showed in the "changes" screen (and a check mark appeared next to the item in the solution explorer). After saving, the item no longer appeared in the "Changes" screen (and the icon in solution explorer changed back to a lock).

This issue may have occurred due to one of the two recent changes I made to the project although I haven't had time to attempt to reproduce the scenario.

1) I manually (outside of VS) did some copying/backups to deploy a new version of a third party js lib. original folder structure: c:\\git\\solution\\webProj\\scripts\\jwplayer\\premium\\jwplayer.js c:\\git\\solution\\webProj\\scripts\\jwplayer\\free\\jwplayer.js

new folder structure: c:\\git\\solution\\webProj\\scripts\\jwplayer\\ c:\\git\\solution\\webProj\\scripts\\jwplayer\\jwplayer-6.11__MACOSX c:\\git\\solution\\webProj\\scripts\\jwplayer\\jwplayer-6.11\\jwplayer c:\\git\\solution\\webProj\\scripts\\jwplayer\\jwplayerOriginal\\

This was an attempt to isolate the jwplayer.js (and other required files) into the jwplayer directory. The new __MACOS directory had filenames starting with a ".". There's a theory that the path to those files could be throwing and error during VS 2013's processing of changes.

2) I had recently gotten nuget updates. Caveat, prior to the nuget update, I had removed the reference to the .map files in the base js files under the scripts directory (long bad story). When I tried to update from nuget, nuget recognized the changes and failed the update, but still updated web.config and packages. This resulted in a mismatch between what nuget thought was installed and what was actually installed. I used the VS 2013/git integration to "undo" each of the updates, but may have missed something.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM