将* .sdf文件添加到.gitignore可能会产生的影响 [英] Possible implications of of adding *.sdf files to .gitignore

查看:260
本文介绍了将* .sdf文件添加到.gitignore可能会产生的影响的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近把一个Visual Studio C ++项目推到了github上。我注意到VS创建了一个相对较大(〜25MB)的.sdf文件。我试图删除我的工作区中的这个文件,看是否VS会抛出一个错误。在VS中打开项目没有错误报告和它的文件被重新创建。因此,我正在考虑删除当前存储在我的存储库中的.sdf文件,并向repo的.gitignore文件中添加一个* .sdf条目。



当用户拉第一次回购的内容并在Visual Studio中打开它时,VS将不得不生成.sdf文件。但是,如果用户从其他用户的repo中提取更改,那么.sdf是否会失去同步,如果有,是否有人知道VS是否会以合理的方式处理此问题(例如,重新生成.sdf文件)?有没有其他的影响,我不知道?



任何输入将不胜感激!

解决方案

它看起来像 *。sdf 通常包含在.gitignore文件中。如 .gitignore for Visual Studio项目和解决方案,但也可以在 GitHub gitignore项目

一个潜在的影响可能是关于某些本地修改被覆盖:请参阅本地数据缓存同步不会将客户端更改保存到sdf文件



但除此之外,忽略来自源代码控制库的缓存文件是一种很好的做法。


I recently pushed a Visual Studio C++ project to github. I've noticed that VS creates a .sdf file that's relatively large (~25MB). I tried deleting this file in my workspace to see whether or VS would throw an error. Upon open the project in VS no errors where reported and it the file was recreated. I'm considering, therefore, removing the .sdf file that's currently in my repository and adding an *.sdf entry to the repo's .gitignore file.

The consequence of this is that when a user pulls the contents of the repo and opens it in Visual Studio for the first time, VS will have to generate the .sdf file. However, if a user pulls changes from the repo made by another user, could the .sdf get out of sync, and if so, does anyone know if VS would handle this in a sensible way (e.g. regenerating the .sdf file)? Could there be other implications that I'm not aware of?

Any input would be much appreciated!

解决方案

It looks like *.sdf are usually included in .gitignore files,; as illustrated in ".gitignore for Visual Studio Projects and Solutions", but also on the GitHub gitignore project.

One potential effect can be regarding some local modifications being overriden: see "Local Data Cache Sync does not save client changes to sdf file".

But other than that, ignoring cache file from a source control repository is a good practice.

这篇关于将* .sdf文件添加到.gitignore可能会产生的影响的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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