Visual Studio - AppBuilder - Git Hub - .sou文件问题 [英] Visual Studio - AppBuilder - Git Hub - .sou file issue

查看:125
本文介绍了Visual Studio - AppBuilder - Git Hub - .sou文件问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Telerik的AppBuilder上开始了一个项目,然后开始在Visual Studio 2015中开发这个项目。我能够提交。请注意,我有一台台式机和笔记本电脑,都使用VS2015并开始执行此项目。所以,几周前我能够在桌面和笔记本电脑上进行提交和同步。然后,我在桌面上进行了一些更改并尝试登录,现在,当尝试同步时,出现无法访问.suo文件,此后在桌面上无法登录到Git,但在笔记本电脑上



任何想法有什么问题以及如何解决它?

解决方案

您不应该将 .suo 文件检入Git,它们包含不应共享的用户数据。相反,你应该标记它们被Git忽略,以便它们永远不会被检测为未被跟踪的文件。



但是,Git只会忽略存储库中已存在 的文件。首先,将 .suo 文件添加到您的<$ 文件中,然后您可以忽略它们。 C $ C>的.gitignore 。在您的Git存储库的底部创建一个 .gitignore 文件,并添加以下行:

  *。suo 

,更好然后,下载 VisualStudio.gitignore 文件并将其命名为 .gitignore ,并将其放在您的存储库的根目录下。该文件是Visual Studio项目的一个很好的 .gitignore 规则集。 (如果你在Visual Studio中创建了你的项目,它会促使你设置它 - 但不用担心,它不会太迟!)

接下来,从存储库中删除 .suo 文件。如果问题中的 .suo 文件是 MySolution.suo

  git rm --cached MySolution.suo 
git commit -m删除.suo文件MySolution.suo

现在当Visual Studio更改 .suo 文件时,不会提示您添加或检查它in。


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?

解决方案

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.

这篇关于Visual Studio - AppBuilder - Git Hub - .sou文件问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆