c# - 配置 mercurial .hgingore 以忽略目录中除 'repositories.config' 之外的所有文件和文件夹

标签 c# .net vb.net mercurial nuget

我有一个多项目解决方案,其目录结构如下所示

我想要的是忽略路径为 library-management-system\packages 的所有文件和文件夹。但是 packages 文件夹有一个名为 repositories.config 的文件,我不想被 Mercurial 忽略。

我该怎么做?

Folder PATH listing for volume PARIMAL
Volume serial number is 00650067 DD35:25E5
R:\LIBRARY-MANAGEMENT-SYSTEM
|   LibraryManagementSystem.sln
|   LibraryManagementSystem.sln.DotSettings.user
|   .hgignore
|   
+---CybotechDomain
|   |   App.config
|   |   CybotechDomain.csproj
|   |   CybotechDomain.csproj.user
|   |   
|   +---Entity
|   |       Batch.cs
|   |       Book.cs
|   |       BookIssue.cs
|   |       Course.cs
|   |       Faculty.cs
|   |       Manager.cs
|   |       Person.cs
|   |       Semester.cs
|   |       Student.cs
|   |       
|   +---Properties
|   |       AssemblyInfo.cs
|   |       
|   +---bin
|   |   \---Debug
|   |           CybotechDomain.dll.config
|   |           CybotechDomain.dll
|   |           CybotechDomain.pdb
|   |           
|   \---obj
|       \---Debug
|           |   DesignTimeResolveAssemblyReferencesInput.cache
|           |   CybotechDomain.pdb
|           |   CybotechDomain.dll
|           |   CybotechDomain.csproj.FileListAbsolute.txt
|           |   
|           \---TempPE
+---LibraryData
|   |   App.config
|   |   LibraryData.csproj
|   |   packages.config
|   |   
|   +---Data
|   |       BookRepository.cs
|   |       CourseRepository.cs
|   |       FacultyRepository.cs
|   |       IRepository.cs
|   |       IUnitOfWork.cs
|   |       LibraryContext.cs
|   |       LibraryInitializer.cs
|   |       LibraryUnitOfWork.cs
|   |       StudentRepository.cs
|   |       
|   +---Properties
|   |       AssemblyInfo.cs
|   |       
|   +---bin
|   |   \---Debug
|   |           CybotechDomain.dll
|   |           EntityFramework.dll
|   |           CybotechDomain.pdb
|   |           EntityFramework.xml
|   |           LibraryData.dll.config
|   |           LibraryData.dll
|   |           LibraryData.pdb
|   |           
|   \---obj
|       \---Debug
|           |   DesignTimeResolveAssemblyReferencesInput.cache
|           |   LibraryData.csprojResolveAssemblyReference.cache
|           |   LibraryData.pdb
|           |   LibraryData.dll
|           |   LibraryData.csproj.FileListAbsolute.txt
|           |   
|           \---TempPE
+---LibraryManager
|   |   LibraryManager.csproj
|   |   LibraryManager.csproj.DotSettings
|   |   Program.cs
|   |   app.config
|   |   packages.config
|   |   
|   +---Application
|   |       ApplicationModule.cs
|   |       Composition.cs
|   |       
|   +---Icons
|   |       books.ico
|   |       course.ico
|   |       
|   +---Images
|   |       add-16.png
|   |       add-24.png
|   |       book-32.png
|   |       book-48.png
|   |       book-issue.png
|   |       book-read.png
|   |       books.png
|   |       course.png
|   |       delete-16.png
|   |       delete-24.png
|   |       header.jpg
|   |       issue_book.png
|   |       lock-32.png
|   |       logo.PNG
|   |       orb.jpg
|   |       student-32.png
|   |       teacher-32.png
|   |       
|   +---Properties
|   |       AssemblyInfo.cs
|   |       Resources.Designer.cs
|   |       Resources.resx
|   |       Settings.Designer.cs
|   |       Settings.settings
|   |       
|   +---View
|   |       BookForm.Designer.cs
|   |       BookForm.cs
|   |       BookForm.resx
|   |       BookIssueForm.Designer.cs
|   |       BookIssueForm.cs
|   |       BookIssueForm.resx
|   |       BookListForm.Designer.cs
|   |       BookListForm.cs
|   |       BookListForm.resx
|   |       CourseForm.Designer.cs
|   |       CourseForm.cs
|   |       CourseForm.resx
|   |       Extensions.cs
|   |       FacultyAddForm.Designer.cs
|   |       FacultyAddForm.cs
|   |       FacultyAddForm.resx
|   |       InputBox.cs
|   |       InputForm.Designer.cs
|   |       InputForm.cs
|   |       InputForm.resx
|   |       LoginForm.Designer.cs
|   |       LoginForm.cs
|   |       LoginForm.resx
|   |       MainForm.Designer.cs
|   |       MainForm.cs
|   |       MainForm.resx
|   |       OfficeFormWithStatus.cs
|   |       StudentAddForm.Designer.cs
|   |       StudentAddForm.cs
|   |       StudentAddForm.resx
|   |       
|   +---bin
|   |   \---Debug
|   |       |   LibraryManager.vshost.exe.config
|   |       |   LibraryManager.vshost.exe.manifest
|   |       |   LibraryManager.vshost.exe
|   |       |   CybotechDomain.dll
|   |       |   EntityFramework.dll
|   |       |   Equin.ApplicationFramework.BindingListView.dll
|   |       |   LibraryData.dll
|   |       |   Ninject.dll
|   |       |   System.Data.SqlServerCe.dll
|   |       |   CybotechDomain.pdb
|   |       |   LibraryData.pdb
|   |       |   EntityFramework.xml
|   |       |   Equin.ApplicationFramework.BindingListView.pdb
|   |       |   Ninject.pdb
|   |       |   Ninject.xml
|   |       |   LibraryManager.exe.config
|   |       |   LibraryManager.exe
|   |       |   LibraryManager.pdb
|   |       |   
|   |       +---x86
|   |       |   |   sqlceca40.dll
|   |       |   |   sqlcecompact40.dll
|   |       |   |   sqlceer40EN.dll
|   |       |   |   sqlceme40.dll
|   |       |   |   sqlceqp40.dll
|   |       |   |   sqlcese40.dll
|   |       |   |   
|   |       |   \---Microsoft.VC90.CRT
|   |       |           Microsoft.VC90.CRT.manifest
|   |       |           msvcr90.dll
|   |       |           README_ENU.txt
|   |       |           
|   |       \---amd64
|   |           |   sqlceca40.dll
|   |           |   sqlcecompact40.dll
|   |           |   sqlceer40EN.dll
|   |           |   sqlceme40.dll
|   |           |   sqlceqp40.dll
|   |           |   sqlcese40.dll
|   |           |   
|   |           \---Microsoft.VC90.CRT
|   |                   Microsoft.VC90.CRT.manifest
|   |                   msvcr90.dll
|   |                   README_ENU.txt
|   |                   
|   \---obj
|       \---x86
|           \---Debug
|               |   DesignTimeResolveAssemblyReferencesInput.cache
|               |   LibraryManager.csproj.FileListAbsolute.txt
|               |   DesignTimeResolveAssemblyReferences.cache
|               |   LibraryManager.csprojResolveAssemblyReference.cache
|               |   Cybotech.Properties.Resources.resources
|               |   Cybotech.View.BookForm.resources
|               |   Cybotech.View.BookIssueForm.resources
|               |   Cybotech.View.BookListForm.resources
|               |   Cybotech.View.CourseForm.resources
|               |   Cybotech.View.FacultyAddForm.resources
|               |   Cybotech.View.InputForm.resources
|               |   Cybotech.View.LoginForm.resources
|               |   Cybotech.View.MainForm.resources
|               |   Cybotech.View.StudentAddForm.resources
|               |   LibraryManager.csproj.GenerateResource.Cache
|               |   LibraryManager.pdb
|               |   LibraryManager.exe
|               |   
|               \---TempPE
|                       Properties.Resources.Designer.cs.dll
|                       
+---LibraryTest
|   |   App.config
|   |   LibraryTest.csproj
|   |   LibraryTester.cs
|   |   packages.config
|   |   
|   +---Properties
|   |       AssemblyInfo.cs
|   |       
|   +---bin
|   |   \---Debug
|   |           CybotechDomain.dll
|   |           EntityFramework.dll
|   |           LibraryData.dll
|   |           CybotechDomain.pdb
|   |           LibraryData.pdb
|   |           EntityFramework.xml
|   |           LibraryTest.dll.config
|   |           LibraryTest.dll
|   |           LibraryTest.pdb
|   |           
|   \---obj
|       \---Debug
|           |   DesignTimeResolveAssemblyReferencesInput.cache
|           |   LibraryTest.csprojResolveAssemblyReference.cache
|           |   LibraryTest.pdb
|           |   LibraryTest.dll
|           |   LibraryTest.csproj.FileListAbsolute.txt
|           |   
|           \---TempPE
+---packages
|   |   repositories.config
|   |   
|   +---EntityFramework.4.3.1
|   |   |   EntityFramework.4.3.1.nuspec
|   |   |   EntityFramework.4.3.1.nupkg
|   |   |   
|   |   +---Content
|   |   |       App.config.transform
|   |   |       Web.config.transform
|   |   |       
|   |   +---lib
|   |   |   \---net40
|   |   |           EntityFramework.dll
|   |   |           EntityFramework.xml
|   |   |           
|   |   \---tools
|   |           EF4.3on.NET4.5Readme.txt
|   |           EntityFramework.PowerShell.dll
|   |           EntityFramework.psd1
|   |           EntityFramework.psm1
|   |           init.ps1
|   |           install.ps1
|   |           migrate.exe
|   |           
|   +---Ninject.3.0.1.10
|   |   |   Ninject.3.0.1.10.nuspec
|   |   |   Ninject.3.0.1.10.nupkg
|   |   |   
|   |   \---lib
|   |       +---net35
|   |       |       Ninject.dll
|   |       |       Ninject.pdb
|   |       |       Ninject.xml
|   |       |       
|   |       +---net40
|   |       |       Ninject.dll
|   |       |       Ninject.pdb
|   |       |       Ninject.xml
|   |       |       
|   |       +---net45-full
|   |       |       Ninject.dll
|   |       |       Ninject.pdb
|   |       |       Ninject.xml
|   |       |       
|   |       +---sl2
|   |       |       Ninject.dll
|   |       |       Ninject.pdb
|   |       |       Ninject.xml
|   |       |       
|   |       +---sl3-wp
|   |       |       Ninject.dll
|   |       |       Ninject.pdb
|   |       |       Ninject.xml
|   |       |       
|   |       +---sl3
|   |       |       Ninject.dll
|   |       |       Ninject.pdb
|   |       |       Ninject.xml
|   |       |       
|   |       +---sl4-windowsphone71
|   |       |       Ninject.dll
|   |       |       Ninject.pdb
|   |       |       Ninject.xml
|   |       |       
|   |       +---sl4
|   |       |       Ninject.dll
|   |       |       Ninject.pdb
|   |       |       Ninject.xml
|   |       |       
|   |       \---sl5
|   |               Ninject.dll
|   |               Ninject.pdb
|   |               Ninject.xml
|   |               
|   +---Microsoft.SqlServer.Compact.4.0.8876.1
|   |   |   SQLCE_EULA_ENU.rtf
|   |   |   Microsoft.SqlServer.Compact.4.0.8876.1.nuspec
|   |   |   Microsoft.SqlServer.Compact.4.0.8876.1.nupkg
|   |   |   
|   |   +---Content
|   |   |       web.config.transform
|   |   |       
|   |   +---lib
|   |   |   \---net40
|   |   |           System.Data.SqlServerCe.dll
|   |   |           
|   |   +---NativeBinaries
|   |   |   +---amd64
|   |   |   |   |   sqlceca40.dll
|   |   |   |   |   sqlcecompact40.dll
|   |   |   |   |   sqlceer40EN.dll
|   |   |   |   |   sqlceme40.dll
|   |   |   |   |   sqlceqp40.dll
|   |   |   |   |   sqlcese40.dll
|   |   |   |   |   
|   |   |   |   \---Microsoft.VC90.CRT
|   |   |   |           Microsoft.VC90.CRT.manifest
|   |   |   |           msvcr90.dll
|   |   |   |           README_ENU.txt
|   |   |   |           
|   |   |   \---x86
|   |   |       |   sqlceca40.dll
|   |   |       |   sqlcecompact40.dll
|   |   |       |   sqlceer40EN.dll
|   |   |       |   sqlceme40.dll
|   |   |       |   sqlceqp40.dll
|   |   |       |   sqlcese40.dll
|   |   |       |   
|   |   |       \---Microsoft.VC90.CRT
|   |   |               Microsoft.VC90.CRT.manifest
|   |   |               msvcr90.dll
|   |   |               README_ENU.txt
|   |   |               
|   |   \---tools
|   |           Install.ps1
|   |           Uninstall.ps1
|   |           VS.psd1
|   |           VS.psm1
|   |           
|   \---Unofficial.BindingListView.1.2.0.0
|       |   Unofficial.BindingListView.1.2.0.0.nuspec
|       |   Unofficial.BindingListView.1.2.0.0.nupkg
|       |   
|       \---lib
|           \---net20
|                   Equin.ApplicationFramework.BindingListView.dll
|                   Equin.ApplicationFramework.BindingListView.pdb
|                   
+---.hg
|   |   00changelog.i
|   |   requires
|   |   hgrc
|   |   cur-message.txt
|   |   
|   \---store
\---.nuget
        NuGet.targets
        NuGet.exe
        NuGet.Config

最佳答案

.hgignore 不会影响已添加到存储库的文件,因此执行所需操作的最简单方法是忽略 packages 文件夹并手动添加packages\repositories.config 文件。

关于c# - 配置 mercurial .hgingore 以忽略目录中除 'repositories.config' 之外的所有文件和文件夹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20474357/

相关文章:

c# - 如何处理 XML 中的非法字符

C# 删除 List<int> 中的重复项

c# - Web API 2 REST 服务高级数据过滤

python - 通过 LAN 发送文件的快速可靠的多平台方式

c# - 如何从xml文件中读取单个节点值

c# - 使用 WPF 绘制数千个数据点的最高效方法?

c# - 在异步等待中等待的工作

.net - 如何使用 DataTrigger 覆盖绑定(bind)属性

.net - 如何使用 GroupBy() 通过 VB.NET 对多列进行分组?

php - 如何在php中调用带有参数值的http post