简体   繁体   English

要忽略的Git .Net文件

[英]Git .Net files to ignore

What are your best practices for Git with .Net? GNet与.Net的最佳实践是什么? What files do you ignore and do not add to your project type? 您忽略哪些文件而不添加到项目类型?

An initial list excludes all temporary build files, 初始列表排除所有临时构建文件,

*.dep *.aps *.vbw *.suo *.obj *.ncb *.plg *.bsc *.ilk 
*.exp *.sbr *.opt *.pdb *.idb *.pch *.res *.user

Also the build directories 还有构建目录

 *\obj
 *\bin
 *\Debug
 *\Release

if you use Rehsarper, exclude its directories too 如果您使用Rehsarper,也要排除其目录

 ./Resharp*

Plus some special files 加上一些特殊文件

 Thumbs.db

Some people also exclude binary files 有些人还排除了二进制文件

 *.exe
 *.dll

It might be worthwhile considering what you want to store in your SCM, rather than a long and possibly never-complete list of exclusions. 这可能是值得考虑你想在你的供应链管理存储,而不是排除长,可能永远不会完成列表的内容。

This is not really git-specific, but rather applies to any version control. 这不是特定于git的,而是适用于任何版本控制。

Ignore the bin and obj folders, and the .user and .suo files (which are user-specific). 忽略bin和obj文件夹,以及.user和.suo文件(用户特定的)。 That is, of course, if you're using Visual Studio. 当然,如果您使用的是Visual Studio。

我使用它作为我所有.net git repos的模板: .gitignore Gist for .net

I exclude all binary and source files that the Visual Studio doesn't need in order to rebuilt the application. 我排除了Visual Studio不需要的所有二进制文件和源文件,以便重建应用程序。
I'm not sure if all VS versions have the same file extensions, but you can experiment if you like. 我不确定所有VS版本是否都有相同的文件扩展名,但如果您愿意,可以进行试验。

Eric Sink has a guide for source control, Source Control HOWTO , and in Chapter 4: Repositories , you can read What can be stored in a repository? Eric Sink有一个源代码控制指南,源代码管理HOWTO ,在第4章:存储库中 ,您可以阅读存储库中可以存储的内容吗? section, which is related to your question. 部分,与您的问题有关。

I don't use Git, but I do ignore files! 我不使用Git,但我确实忽略了文件!

bin obj *.user *.suo *.log *.vbw *.pdb *mdf *ldf 
_UpgradeReport* UpgradeLog* _ReSharper* *.resharper

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM