1

I have the following odd behavior on Team Explorer for Visual Studio Professional 2013 on git:

When I use the command line and do git status on the project directory, it will show me the changed/added files. I can call git add on these files and commit them just fine via the CLI. After I do so, I can go to Visual Studio and push these files, and the changes will sync just fine on the remote server (visual studio online repo). However, in Visual Studio's Team Explorer changes UI, none of these files were showing up in tracked or untracked changes. When I save these files, the little status icon flashes with the "changed" and then immediately switches to "committed" even though it's clear it hasn't been committed.

I've ensured that I have the git tools installed, that the local working directory matches the git project I used with the command line (with the .git folder there), the solution is on the same level as the .git folder, and none of these files are in .gitignore (after all, even if they were, it wouldn't have shown up in the list of files to be added in the command line anyways).

What else should I check? It's at least partially working in that I can sync my local committed changes with the remote repo via Team Explorer. It's just that the changes page is broken. I'm using the CLI for committing changes as a temporary fix, but I'd really like to use the Visual Studio interface instead.

In case its relevant info, I do have another VS solution in the same folder, although I'm not developing it at the moment. I originally cloned this repo via the team explorer.

Thanks in advance.

Daniel Mann
  • 57,011
  • 13
  • 100
  • 120
ProvRI
  • 21
  • 6
  • You mentioned "I can call git add on these files and commit them just fine via the CLI", that means you have committed the changes. You can't see files shows up in tracked or untracked changes on Team Explorer changes UI after you commit the changes. You need to go to Sync UI and push the commits. – Cece Dong - MSFT Oct 26 '15 at 09:01
  • @Cece, sorry you misunderstood. I was trying to commit via Visual Studio BEFORE using the CLI, and only used the CLI afterwards, to see if it was a problem with my git working directory. If I haven't committed the files via CLI yet, then I should see them listed to be committed in Visual Studio, but I don't. – ProvRI Oct 27 '15 at 14:34
  • I can't reproduce your issue on my side, once I save a file, under Changes UI, there are changes in Included Changes, then you can add a commit message and commit the changes. Maybe you can try a new team project , or install a new version of Team Explorer to see whether you'll get the same issue. – Cece Dong - MSFT Oct 28 '15 at 03:14
  • This problem suddenly started on my installation now. I've installed several VS2015 updates lately, but uninstalling every Git-related extensions didn't solve the problem. Nor did updating to the latest Git for Windows from git-scm.com. I've got no idea how to fix this. https://onedrive.live.com/redir?resid=EFC471D37A53DF6E%211045545 – Eivind Gussiås Løkseth Mar 08 '16 at 09:15

2 Answers2

1

I found the problem. I thought I had installed the Git tools extension on Visual Studio, and seeing that certain Git functions like push, pull, and checkout were working, I figured it installed successfully. After I had reinstalled the tools extension, committing and tracking worked again.

ProvRI
  • 21
  • 6
0

I found the solution in another question here: https://stackoverflow.com/a/34747999/1421847

I started using Gulp/Grunt which installed a lot of NodeJS modules that caused a very long path, and the Visual Studio Git integration stopped seeing changes. After deleting the node_modules folder and refreshing the changes view, it started working again until the same Node modules got automatically reinstalled. So adding node_modules to the .gitignore file will probably fix the issue more permanently.

Community
  • 1
  • 1
Eivind Gussiås Løkseth
  • 1,862
  • 2
  • 21
  • 35