1

In my newest .NET Core ASP.MVC project I seem to be unable to ignore the restore.dg file. By default, the Visual Studio .gitignore file is set to ignore the whole .vs/ folder, in which the file is located. As this did not work, I tried several methods how to get rid of the file, yet unsuccessfully.

# Visual Studio 2015 cache/options directory
.vs/
restore.dg
*.dg
.vs/*

Could somebody help me?

Storm
  • 3,062
  • 4
  • 23
  • 54

2 Answers2

3

Remove it from the cache.

git rm --cached .vs/restore.dg
git commit -m "Remove restore.dg from the cache"

See also: How to make Git "forget" about a file that was tracked but is now in .gitignore?

Community
  • 1
  • 1
Shaun Luttin
  • 133,272
  • 81
  • 405
  • 467
1

This might happen after you have already committed this file into the repository. If this is the case you have to remove it using git rm --cached <filename> command and commit this change to the repository. After that it will disappear from git status and will never bother you again.

Alexey Andrushkevich
  • 5,992
  • 2
  • 34
  • 49