49

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.

LookAheadAtYourTypes
  • 1,629
  • 2
  • 20
  • 35
AK_
  • 7,981
  • 7
  • 46
  • 78
  • 3
    I also verified this problem for a git repository cloned directly from visual studio's github extension (without tortoise). So this isn't related to tortoise git. – Sebastião Miranda Dec 16 '15 at 18:54
  • Do you get any error messages in TortoiseGit or git cli? – MrTux Dec 16 '15 at 20:14
  • Nope... And everything was working until the uodate – AK_ Dec 16 '15 at 23:11
  • Is there your/repo/path/.git/index.lock file? – Yue Lin Ho Dec 17 '15 at 09:41
  • @YueLinHo no. but there are an "index" file without a file extenstion, and an "tortoisegit.index" file – AK_ Dec 17 '15 at 10:05
  • So... I take it you already tried those workarounds I mentioned below? The point was: no: it is not a known problem. – VonC Dec 21 '15 at 09:36
  • 1
    I am experiencing the same problem as are some of my coworkers. The suggestions below from @VonC don't resolve the issue :( – NebulaSleuth Dec 28 '15 at 17:24
  • See also, [Git problem with JFM files and Windows 10](http://stackoverflow.com/questions/37704514/visual-studio-2015-database-project-directory-contains-a-file-with-extension-jfm) – jlear Nov 01 '16 at 04:28

6 Answers6

113

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.

meJustAndrew
  • 6,011
  • 8
  • 50
  • 76
Notrace
  • 1,345
  • 1
  • 11
  • 14
  • 1
    The best answer. Short, accurate. Additionally In my case I had to restart VS, but because I had VS open when I was editing .gitignore. – Mr.Y. Jan 12 '16 at 09:27
  • Thanks Equalify!. I added it right under the **#User-specific files** and it worked perfectly. – Phillip Davis Jan 28 '16 at 16:28
  • 1
    Thank you! I only pulled my hair for an hours or so before stumbling onto this. It would have been many more hours. – Brian Reinhold Mar 25 '16 at 11:28
  • 3
    The problem went away briefly when I was upgraded to 2015 Update 2, but came back again shortly thereafter. This solution works for Update 2 as well. – Robin Davies Apr 05 '16 at 15:40
  • Worked fine, just don't accidently add a space behind an entry as it will not be accepted by git. – N Jacobs Jul 19 '16 at 22:30
  • Useful . I clicked on the file and used the menu to ignore it. Then I saw an ignore file at least temporarily. Perhaps the answer could show the image. – VIRTUAL-VOID Nov 16 '16 at 17:01
3

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.

Hassan Rahman
  • 4,953
  • 1
  • 34
  • 32
0

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)
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
0

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

bare: true

to

bare:false
Guy L.
  • 153
  • 1
  • 9
-1

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.

Tunaki
  • 132,869
  • 46
  • 340
  • 423
-1

I experienced same issue and I tried several options from search results but they did not work, I had to restart my system and git command worked again...Voila!!!

Maybe you have spent hours coding and system decides to take a rest a little bit seems alot of things are cached, Just restart and get things refreshed again!

Jean-François Fabre
  • 137,073
  • 23
  • 153
  • 219
David MD
  • 39
  • 3