VB.NET 项目的 Git 忽略文件
我想将 VB.NET 项目置于 Windows 中的 Git 控制下(之前位于 Visual Source Safe 下 - 存储库损坏等漫长的悲伤故事)。 我应该如何设置忽略文件? 我正在考虑使用的排除项是:
- *.exe
- *.pdb
- *.manifest
- *.xml
- *.log (Windows 上的 Git 区分大小写吗?我也应该排除 *.l og 吗?)
- *.scc (我收集这些是 Visual Source Safe 留下的 - 也许我应该删除它们?)
这是一个合理的列表吗? 我应该排除目录吗?
I wan to place a VB.NET project under Git control in Windows (was previously under Visual Source Safe - long sad story of repository corruption, etc.). How should I set up the ignore file? The exclusions I'm thinking of using are:
- *.exe
- *.pdb
- *.manifest
- *.xml
- *.log (is Git case sensitive on Windows? Should I exclude *.l og as well?)
- *.scc (I gather these were left over from Visual Source Safe - maybe I should delete them?)
Is this a sensible list? Should I be excluding directories?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
这是我的 C# 项目:
随着 bin/obj 目录消失,您不需要排除所有 EXE、XML 文件等 - 这很方便,因为这意味着您仍然可以放置在你想要的那些:)(你可能有示例 XML 文件等)
Here's what I have for my C# projects:
With the bin/obj directories gone, you don't need to exclude all EXEs, XML files etc - which is handy, as it means you still get to put in the ones you want :) (You might have sample XML files etc.)
我们使用以下内容,所有共享内容(dll、exe、bat 等)都保存在名为“lib”的文件夹中,这样它就可以保持干净,我们可以将任何我们想要的内容放入 lib 中,并且它不会被忽略规则。
顺便说一句,是的
.gitignore
即使在 Windows 中也是区分大小写的,所以是的,您需要包含多个大小写。 如果您使用 Silverlight 或 WPF 应用程序,Visual Studio 有时会创建Bin
文件夹而不是bin
。 这同样适用于 Obj。 一些外部工具也可以做到这一点。 据我所知,扩展名在所有情况下都是小写的,当然除非你修改它(如果你想从 git add . 命令中删除单个文件,这是另一个黑客,顺便提一句)。We use the following, all of our shared stuff (dll, exe, bat, etc) are kept in a a folder named "lib", this way it stays clean and we can put anything we want in lib and it is excluded from the ignore rules.
BTW, yes
.gitignore
is case sensitive even in Windows, so yes you need to include multiple cases. Visual Studio will sometimes create aBin
folder instead ofbin
if you are working with Silverlight or WPF applications. The same applies for Obj. Some external tools will do that as well. The extension names, from what I have been able to tell, are lowercase in all cases, unless of course you modify it (another hack if you want to remove a single file from thegit add .
command, BTW).在这里维护:
https://github.com/github/gitignore
maintained here:
https://github.com/github/gitignore
删除现有的 .scc 文件。 它们是来源安全的垃圾。
您还需要排除:.licx(许可证文件)、.dll、.suo、.ncb、.vspcc、.vscc 和 .vssscc 文件。 最后三个由 Visual Studio 生成,用于跟踪源代码管理绑定。
Delete the existing .scc files. They're Source Safe junk.
You'll also want to exclude: .licx (license files,) .dll, .suo, .ncb, .vspcc, .vscc, and .vssscc files. The last three are generated by Visual Studio to keep track of source control bindings.
发现这非常全面...
https://github.com/github /gitignore/blob/master/VisualStudio.gitignore
截至 2018 年 3 月 27 日
Found this to be extremely comprehensive...
https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
As of 3/27/2018
不要忘记包含
[Pp]ublish/
Don't forget to include
[Pp]ublish/