Visual Studio - AppBuilder - Git Hub - .sou file i

2020-02-16 03:39发布

I started a project on Telerik's AppBuilder and then started working on that project in Visual Studio 2015. I was able to commit. Note that I have a desktop and laptop, both with VS2015 and working on this project. So, I was able to commit and sync on the Desktop and Laptop a few weeks ago. Then, I made some changes on the desktop and tried to checkin, and now I get "unable to access .suo file for writing" when trying to sync and have been unable to checkin to Git since then on the Desktop, but on the Laptop I can push/pull w/o issue.

Any idea what's wrong and how to fix it?

1条回答
放荡不羁爱自由
2楼-- · 2020-02-16 04:38

You should not be checking in .suo files into Git, they contain user data that should not be shared. Instead, you should be marking them to be "ignored" by Git, so that they will never be checked in and never detected as an untracked file.

However, Git will only ignore files that are not already in the repository. So you must remove them before you can ignore them.

First, add the .suo file to your .gitignore. Create a .gitignore file at the base of your Git repository, and add the following line to it:

*.suo

Or, better yet, download the VisualStudio.gitignore file and name it .gitignore, placing it at the root of your repository. This file is an excellent set of .gitignore rules for Visual Studio projects. (And if you had created your project in Visual Studio it would have prompted you to set this up - but don't worry, it's not too late!)

Next, remove the .suo file from your repository. If the .suo file in question is MySolution.suo:

git rm --cached MySolution.suo
git commit -m"Remove .suo file" MySolution.suo

Now when Visual Studio changes your .suo file, you will not be prompted to add it or check it in.

查看更多
登录 后发表回答