Visual Studio TFS Git not seeing any changes

后端 未结 11 828
后悔当初
后悔当初 2020-12-23 13:13

I\'m not getting something about Visual Studio\'s Git for TFS.

I cloned a colleague\'s solution in Git on TFS and started adding code. I then realised that I needed

相关标签:
11条回答
  • 2020-12-23 13:54

    This is more of a workaround than an explanation, but I found that if I ignored the documentation "when you commit changes, Visual Studio simultaneously stages and commits them" and instead added the modifications to staging with the command

    git add -u .
    

    then Visual Studio suddenly became aware of the modifications and let me commit them locally and sync them with the TFS server. Moreover it then put the 'new file' green cross on the files I had added and I found I could do another commit and then another sync to pick up the additions and deletions I had made.

    Since then Visual Studio is doing what I would expect: when I make a change to the file the file is listed as changed in the commit window.

    I still do not know why Visual Studio failed to pick up the changes until after an initial git add but at least it works now.

    0 讨论(0)
  • 2020-12-23 13:56

    In my case my problem was I am using Linux with symbolic links in the path to my projec (cannot tell if windows with symbolic links has the same problem)

    0 讨论(0)
  • 2020-12-23 13:58

    I'm using VS 2015 Update 1 and also meet this problem. Furthermore, at the same time, the VS' output window told me my VC.opendb file under the solution folder is occupied by another program. According to this, I fixed the issue of occupying: add *.VC.opendb and *.VC.db to the .gitignore file. Then everything goes well.

    0 讨论(0)
  • 2020-12-23 14:01

    I had to add this line to my .gitignore:

    [path to project]/node_modules/
    

    Apparently VS2015 was crashing on some very long path in there and would just decide to give up all hope

    0 讨论(0)
  • 2020-12-23 14:02

    Then i was trying to make changes but files doesn't get effected...There is a easy solution for this. The major problem is one of your git ignore files ignoring your files..

    Open your local repo for instance D://repos, then look file you want

    --> D://repos/project1/HomeViewModel.cs

    --> Right click on it and click on Git Extentions

    --> Choose +Add Files

    --> then Force option

    --> Click on Addfiles..Here you go you file will be added in changes

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