Git issue with Visual Studio 2015

2019-03-08 23:10发布

I have a Visual Studio solution inside a git repository created with TortoiseGit version 1.8.16.0 (git version 2.6.2.windows.1)

I just updated Visual Studio from 2015 to 2015 Update 1, and it stopped tracking changes on my files. also it won't allow me to commit anything.

Is this some sort of a known problem? are there any solutions?


update

(ironic title...) VS tracks unsaved files as "changed" and saved files appear to be "unchanged"

switching branches is behaves correctly and results in an error if there are uncommitted (real )changes


update 2

could this in the output window could have anything to do with the error:

Opening repositories:

Could not open 'C:/[project path].VC.opendb': The process cannot access the file because it is being used by another process.

Could not open 'C:/[project path].VC.opendb': The process cannot access the file because it is being used by another process.

5条回答
三岁会撩人
2楼-- · 2019-03-08 23:42

Since the Visual Studio 2015 update 1 release notes and its "Known Issues and Fixed Bugs" page does not mention anything related to Git, try to:

  • make a fresh clone of your repo from the command line (git clone)
  • import the solution in Visual Studio and check if the git repo is detected

Or:

https://regmedia.co.uk/2015/12/01/1.jpg

  • check that you can add new files
  • close Visual Studio
  • overwrite that new repo by your own (delete and replace the .git by your own, and copy your worktree over the one used by Visual Studio)
查看更多
闹够了就滚
3楼-- · 2019-03-08 23:49

I have same issue with db.lock file ...

Solution with images are as follow:

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

Git will ignore these files for next commit.

查看更多
混吃等死
4楼-- · 2019-03-08 23:50

Simpler solution which worked for me (also for VS 2017): open .git\config file and change

bare: true

to

bare:false
查看更多
Lonely孤独者°
5楼-- · 2019-03-08 23:50

To make VS 2015 not show the unmodified files, you need to set core.autocrlf=false in your Git configuration by console. It sames newer versions of git core includes one new line on file with crlf (VS doesn't show the new line).

To set it through all your repositories write

git config core.autocrlf false

and it will be deactivated.

查看更多
闹够了就滚
6楼-- · 2019-03-09 00:06

I had the exact same issue as you and spent hours trying to get it to work, including re-cloning.

I solved it on my end by adding the *.VC.opendb and *.VC.db files to the .gitignore file of my project.

As soon as I returned to Visual Studio all my pending changes were showing. As far as I can tell it's all working normally again.

查看更多
登录 后发表回答