0

Everytime I open any solution that I have made no changes to in Visual Studio I get lots of random cache/configuration/assemblyInfo etc. files showing up in the 'Git Changes' window. It's become annoying as I know it's probably something that's changed in the background even though I didn't consciously change it but I never know what to do with them, delete? commit?

So my questions are;

  1. If you have them, what do you do with them? Commit or delete?
  2. How to get these to not show up here? Something to do with a gitignore file? If so please give details on how to do this, I've not had a lot of involvement with this so far.

Thank you

random files showing up in git changes in visual studio

imsan
  • 359
  • 4
  • 17
  • 1
    Don't delete them, just add a `.gitignore` file at the root of your project which lists the files to ignore. The q&a suggested as duplicate has a link to a standard `.gitignore` file for C# projects : https://github.com/github/gitignore/blob/master/VisualStudio.gitignore – LeGEC May 07 '21 at 08:30
  • 1
    If some of these files are already tracked, you can remove them from git : see for example https://stackoverflow.com/questions/1143796/remove-a-file-from-a-git-repository-without-deleting-it-from-the-local-filesyste . Note that most of these files are generated anyway, and will be re-generated on your next Run or Compile action ; the ones that you may want to keep are the configuration files (e.g : the ones which store settings for your IDE) – LeGEC May 07 '21 at 08:34

0 Answers0