0

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?

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
Robert Green MBA
  • 1,834
  • 1
  • 22
  • 45
  • 1
    What is in your `.gitignore` file? The `.suo` file is user-specific, and thus should generally not be committed to Git. Also please post the output of `git status` from the command line (probably Git Bash). – Scott Weldon Aug 23 '16 at 21:51

1 Answers1

1

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.

Edward Thomson
  • 74,857
  • 14
  • 158
  • 187
  • Thanks for the reply. I have a few questions. – Robert Green MBA Aug 24 '16 at 14:47
  • There was already a .gitignore at the root of the solution. So I added in a new line: *.suo Now do I remove the .suo from the repository. I have downloaded the Git CLI and I have navigated to the project's root. When I execute the git rm ... command I get an error: "fatal: pathspec 'MySolution.suo' did not match any files. Should I be inside the .git folder? or on the root of the project where the .gitignore file is? – Robert Green MBA Aug 24 '16 at 15:06
  • 1
    @RobertGreen Just to be clear, replace `MySolution.suo` with the path to your `.suo` file. Or you can run `git rm --cached '*.suo'` to remove them all from the repository. (Correct, run this command from the root of your project, not from inside the `.git` folder.) – Edward Thomson Aug 24 '16 at 15:12
  • @@EdwardThomson thanks for your assistance, maybe you can answer the next thing that happened after you helped me solve for the above... – Robert Green MBA Aug 24 '16 at 17:34