添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
拉风的汉堡包  ·  jai-core-1.1.3.jar ...·  2 年前    · 
朝气蓬勃的豆腐  ·  Meta ...·  2 年前    · 

Not sure what it is with Visual Studio 2022 but it seems it is not ignoring the .vs table in the .gitignore file in my repo. I use Azure Devops Repo and Visual Studio usually for my code management. I keep seeing these files no matter what I add to the .gitignore file though.

I added this to the .gitignore, so is there something else I need to do as I am confused why this wouldn't be ignored.

This .gitignore file was automatically created by Microsoft(R) Visual Studio.

This is more goofiness between Git and Microsoft that requires some new custom circus trick to work....but here it is!

  • Make sure your Git repo has a .git and .gitignore folder and file.
  • In the .gitignore file add the following lines with your Git project name to make sure your .vs folder is ignored:
  • {yourgitprojectname}/.vs

  • Delete the ".vs" folder. Be sure to leave the ".git folder intact. Realize when you do this you remove the Git-to-Visual Studio project connection, but your Git repo still exists.
  • In the lower right corner of Visual Studio look for your Git repo again and click it. It should rebuild your .vs folder again. But now ".vs" will be ignored.
  • Push your code to Azure, GitHub, etc. again. The ".vs" folder should not appear in your online repo and should be hidden. I use GitHub and it worked up there, so test your Azure.
  • It shows up in the .vs directory in the root of the repo. Example I added .vs/ and /.vs which doesn't work unless you can't actually have both.

    Just keep seeing these show up every time making changes