Git issue with Visual Studio 2015

跟風遠走 提交于 2019-12-02 17:24:44
Notrace

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.

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

Solution with images are as follow:

Git will ignore these files for next commit.

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:

  • 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)

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

bare: true

to

bare:false
Jose Luis Guerra Infante

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!