Git changes not showing in VS2013 Update 2

后端 未结 8 1078
旧巷少年郎
旧巷少年郎 2021-02-19 08:02

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

相关标签:
8条回答
  • 2021-02-19 08:26

    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!

    0 讨论(0)
  • 2021-02-19 08:26

    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.

    0 讨论(0)
  • 2021-02-19 08:32

    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.

    0 讨论(0)
  • 2021-02-19 08:39

    Open the .gitignore file with Editor or Notepad++, and delete the lines that include the files you want to track.

    0 讨论(0)
  • 2021-02-19 08:39

    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.

    0 讨论(0)
  • 2021-02-19 08:41

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

    0 讨论(0)
提交回复
热议问题