C# 将mercurial.hgingore配置为忽略除';repositories.config';

C# 将mercurial.hgingore配置为忽略除';repositories.config';,c#,.net,vb.net,mercurial,nuget,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 |

我有一个目录结构如下的多项目解决方案

我想要的是忽略路径为
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

该文件夹是否恰好是NuGet包文件夹?在这种情况下,您可以告诉NuGet自身忽略该文件夹,配置文件除外:


当然,这仅适用于使用集成到Visual Studio中的版本控制系统的情况。

该文件夹是否恰好是NuGet软件包文件夹?在这种情况下,您可以告诉NuGet自身忽略该文件夹,配置文件除外:


当然,这仅适用于使用集成到Visual Studio中的版本控制系统。

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

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

在.hgignore

syntax: regexp
^library-management-system/packages/(?!repositories\.config).+$

在.hgignore中使用先行regexp条目

syntax: regexp
^library-management-system/packages/(?!repositories\.config).+$

不,我没有集成任何版本控制。它是外部的!我也不打算整合任何东西!不,我没有集成任何版本控制。它是外部的!我也不打算整合任何东西!