适用于 Visual Studio 2008 项目的 Mercurial .hgignore

发布于 2024-07-04 03:10:37 字数 299 浏览 10 评论 0原文

使用 Visual Studio 2008 时,.hgignore 文件的最佳设置是什么?

我主要是自己开发,只是偶尔克隆存储库供其他人使用。

我正在考虑 obj 文件夹、.suo、.sln、.user 文件等。可以仅包含它们还是有我不应该包含的文件?

谢谢!

ps:目前我执行以下操作:忽略所有 .pdb 文件和所有 obj 文件夹。

# regexp syntax.
syntax: glob
*.pdb

syntax: regexp
/obj/

What is a good setup for .hgignore file when working with Visual Studio 2008?

I mostly develop on my own, only occasionly I clone the repository for somebody else to work on it.

I'm thinking about obj folders, .suo, .sln, .user files etc.. Can they just be included or are there file I shouldn't include?

Thanks!

p.s.: at the moment I do the following : ignore all .pdb files and all obj folders.

# regexp syntax.
syntax: glob
*.pdb

syntax: regexp
/obj/

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

め可乐爱微笑 2024-07-11 03:10:37

这里有一些令人讨厌的:Matlab 和 Excel/Office 自动保存。

# use glob syntax
syntax: glob

# Matlab ignore files
*.asv

# Microsoft Office
~$*

如果我不小心添加了它们,然后关闭了打开的真实文件,Excel 和/或 Matlab 将删除自动保存,然后 Mercurial 将陷入困境,想知道它们去了哪里。 我确信还有其他程序可以做类似的事情。

Here are a couple pesky ones: Matlab and Excel/Office autosaves.

# use glob syntax
syntax: glob

# Matlab ignore files
*.asv

# Microsoft Office
~$*

If I accidentally add them and then close the real file that was open, Excel and/or Matlab will delete the auto-save and then Mercurial will be stuck wondering where they went. I'm sure there are other programs that do similar things.

岁吢 2024-07-11 03:10:37

我使用的其他一些:

output
PrecompiledWeb
_UpgradeReport_Files

#Guidance Automation Toolkit
*.gpState
#patches
*.patch

some others I use:

output
PrecompiledWeb
_UpgradeReport_Files

#Guidance Automation Toolkit
*.gpState
#patches
*.patch
羁〃客ぐ 2024-07-11 03:10:37

我的 Mercurial .hgignore 文件内容:

syntax: glob
#-- Files
*.bak.*
*.bak
thumbs.db

#-- Directories
App_Data/*
bin/
obj/
_ReSharper.*/
tmp/

#-- Microsoft Visual Studio specific
*.user
*.suo

#-- MonoDevelop specific
*.pidb
*.userprefs
*.usertasks

请记住,我主要使用 Microsoft Visual Studio 以及偶尔使用 MonoDevelop 处理 WinForms、ASP.NET MVC 和移动项目。 根据您的工具集和项目类型,您可能会遇到其他应忽略的文件。

我尝试在 CodePaste.NET 上保留最新版本 http://codepaste.net/zxov7i

My Mercurial .hgignore file contents:

syntax: glob
#-- Files
*.bak.*
*.bak
thumbs.db

#-- Directories
App_Data/*
bin/
obj/
_ReSharper.*/
tmp/

#-- Microsoft Visual Studio specific
*.user
*.suo

#-- MonoDevelop specific
*.pidb
*.userprefs
*.usertasks

Keep in mind that I mainly work on WinForms, ASP.NET MVC and Mobile projects using Microsoft Visual Studio and occasionally MonoDevelop. Depending on your toolset and project types, you will probably encounter other files that should be ignored.

I try to keep the latest version on CodePaste.NET at http://codepaste.net/zxov7i

做个ˇ局外人 2024-07-11 03:10:37

以下是我的 C# Visual Studio 项目的 .hgignore 内容:

syntax: glob
*.user
*.ncb
*.nlb
*.suo
*.aps
*.clw
*.pdb
*\Debug\*
*\Release\*

一些注意事项:

  1. 如果您有自定义“版本”
    除了“调试”和“发布”之外,您
    可能需要添加它们。
  2. 手动编辑时要小心
    .hgignore。 如果你制定一个语法
    错误,那么hgtortoise就不会
    不再打开提交对话框。

Here is the content of my .hgignore for C# Visual Studio projects:

syntax: glob
*.user
*.ncb
*.nlb
*.suo
*.aps
*.clw
*.pdb
*\Debug\*
*\Release\*

A few notes:

  1. If you have custom "releases"
    besides "Debug" and "Release", you
    may need to add them.
  2. Be careful when you manually edit your
    .hgignore. If you make a syntax
    error, then hgtortoise will no
    longer open the commit dialog.
¢蛋碎的人ぎ生 2024-07-11 03:10:37

我感觉自己被排除在谈话之外了。 这是我的 .hgignore 文件。 它涵盖了一般的 C#、C++ 和 Visual Studio 开发,包括 COM 内容(类型库)、一些最终构建器文件、CodeRush、ReSharper 和 Visual Studio 项目升级。 它对于现代(c.2015)网络开发也有一些忽略。

syntax: glob

* - [Cc]opy
* - [Cc]opy/
* - [Cc]opy (?)/
* - [Cc]opy.*
* - [Cc]opy (?).*
**/.*
**/scss/*.css
*.*scc
*.FileListAbsolute.txt
*.aps
*.bak
*.bin
*.[Cc]ache
*.clw
*.css.map
*.eto
*.exe
*.fb6lck
*.fbl6
*.fbpInf
*.ilk
*.lib
*.log
*.ncb
*.nlb
*.nupkg
*.obj
*.old
*.orig
*.patch
*.pch
*.pdb
*.plg
*.[Pp]ublish.xml
*.rdl.data
*.sbr
*.scc
*.sig
*.sqlsuo
*.suo
*.svclog
*.tlb
*.tlh
*.tli
*.tmp
*.user
*.vshost.*
*.docstates
*DXCore.Solution
*_i.c
*_p.c
__MVC_BACKUP/
_[Rr]e[Ss]harper.*/
_UpgradeReport_Files/
Ankh.Load
Backup*
[Bb]in/
bower_components/
[Bb]uild/
CVS/
[Dd]ebug/
[Ee]xternal/
hgignore[.-]*
ignore[.-]*
lint.db
node_modules/
[Oo]bj/
[Pp]ackages/
PrecompiledWeb/
[Pp]ublished/
[Rr]elease/
svnignore[.-]*
[Tt]humbs.db
UpgradeLog*.*

I feel left out of the conversation. Here's my .hgignore file. It covers C#, C++ and Visual Studio development in general, including COM stuff (type libraries), some final builder files, CodeRush, ReSharper, and Visual Studio project upgrades. It also has some ignores for modern (c.2015) web development.

syntax: glob

* - [Cc]opy
* - [Cc]opy/
* - [Cc]opy (?)/
* - [Cc]opy.*
* - [Cc]opy (?).*
**/.*
**/scss/*.css
*.*scc
*.FileListAbsolute.txt
*.aps
*.bak
*.bin
*.[Cc]ache
*.clw
*.css.map
*.eto
*.exe
*.fb6lck
*.fbl6
*.fbpInf
*.ilk
*.lib
*.log
*.ncb
*.nlb
*.nupkg
*.obj
*.old
*.orig
*.patch
*.pch
*.pdb
*.plg
*.[Pp]ublish.xml
*.rdl.data
*.sbr
*.scc
*.sig
*.sqlsuo
*.suo
*.svclog
*.tlb
*.tlh
*.tli
*.tmp
*.user
*.vshost.*
*.docstates
*DXCore.Solution
*_i.c
*_p.c
__MVC_BACKUP/
_[Rr]e[Ss]harper.*/
_UpgradeReport_Files/
Ankh.Load
Backup*
[Bb]in/
bower_components/
[Bb]uild/
CVS/
[Dd]ebug/
[Ee]xternal/
hgignore[.-]*
ignore[.-]*
lint.db
node_modules/
[Oo]bj/
[Pp]ackages/
PrecompiledWeb/
[Pp]ublished/
[Rr]elease/
svnignore[.-]*
[Tt]humbs.db
UpgradeLog*.*
揽月 2024-07-11 03:10:37

这是我与 VS2008 一起使用的标准 .hgignore 文件,该文件最初是从 Git 忽略文件修改而来的:

# Ignore file for Visual Studio 2008

# use glob syntax
syntax: glob

# Ignore Visual Studio 2008 files
*.obj
*.exe
*.pdb
*.user
*.aps
*.pch
*.vspscc
*_i.c
*_p.c
*.ncb
*.suo
*.tlb
*.tlh
*.bak
*.cache
*.ilk
*.log
*.lib
*.sbr
*.scc
[Bb]in
[Dd]ebug*/
obj/
[Rr]elease*/
_ReSharper*/
[Tt]est[Rr]esult*
[Bb]uild[Ll]og.*
*.[Pp]ublish.xml

Here's my standard .hgignore file for use with VS2008 that was originally modified from a Git ignore file:

# Ignore file for Visual Studio 2008

# use glob syntax
syntax: glob

# Ignore Visual Studio 2008 files
*.obj
*.exe
*.pdb
*.user
*.aps
*.pch
*.vspscc
*_i.c
*_p.c
*.ncb
*.suo
*.tlb
*.tlh
*.bak
*.cache
*.ilk
*.log
*.lib
*.sbr
*.scc
[Bb]in
[Dd]ebug*/
obj/
[Rr]elease*/
_ReSharper*/
[Tt]est[Rr]esult*
[Bb]uild[Ll]og.*
*.[Pp]ublish.xml
指尖微凉心微凉 2024-07-11 03:10:37

这是特定于 C# 项目的,但我忽略这些文件/目录:

  • *.csproj.user
  • /obj/*
  • /bin/*
  • *.ncb
  • *.suo

在我忽略所有这些文件后,在其他机器上运行代码库中的代码没有任何问题。 找出需要保留的内容的最简单方法是复制该文件夹并开始删除您认为不需要的内容。 继续尝试构建,只要可以成功构建就继续删除。 如果删除太多,请从源文件夹中复制。

最后,您将拥有一个不错的目录,其中包含必须提交的唯一文件。

This is specific to a C# project, but I ignore these files/directories:

  • *.csproj.user
  • /obj/*
  • /bin/*
  • *.ncb
  • *.suo

I have no problems running the code in the depot on other machines after I ignore all of these files. The easiest way to find out what you need to keep is to make a copy of the folder and start deleting things you think aren't necessary. Keep trying to build, and as long as you can build successfully keep on deleting. If you delete too much, copy it from the source folder.

In the end you'll have a nice directory full of the only files that have to be committed.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文