dotnet-ignore 1.2.0

dotnet tool install --global dotnet-ignore --version 1.2.0
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local dotnet-ignore --version 1.2.0
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=dotnet-ignore&version=1.2.0
                    
nuke :add-package dotnet-ignore --version 1.2.0
                    

dotnet-ignore

build

Global .NET tool that downloads .gitignore files from the github/gitignore repository.

Requirements

Installation

dotnet tool install -g dotnet-ignore

The global-tool install directory is ~/.dotnet/tools on macOS/Linux (%USERPROFILE%\.dotnet\tools on Windows). If dotnet ignore is not found after install, add it to PATH:

# zsh / bash (macOS, Linux)
export PATH="$PATH:$HOME/.dotnet/tools"

Usage

Download and merge .gitignore files by name (case insensitive, with or without the .gitignore suffix; multiple names are merged into one file):

dotnet ignore get VisualStudio,Node

Remove comments, duplicate and empty lines to minimize the file size:

dotnet ignore get VisualStudio,Node -m

Save the file into a specific directory:

dotnet ignore get VisualStudio -d ./path/to/dir

List all available files:

dotnet ignore list

List only file names without the .gitignore suffix:

dotnet ignore list -s

Run dotnet ignore -h for the complete command description.

Releasing

Every merge to master triggers the publish workflow, which waits for approval before pushing to NuGet:

  1. Prepare the release PR: bump <Version> in src/CliTool/CliTool.csproj and add a CHANGELOG.md entry.
  2. Merge the PR to master. The publish workflow starts and waits for approval.
  3. Approve the run: Actions → the publish run → Review deployments → Approve and deploy. The package is pushed to NuGet via Trusted Publishing (no API keys).

The workflow can also be started manually (Actions → publish → Run workflow), subject to the same approval. Every push to master creates a pending run; the approval step is the release control.

The approval gate is the production environment, which already lists you as a required reviewer and allows master as the only deployment source — every publish run pauses for your approval (Review deployments → Approve and deploy). The NuGet Trusted Publishing policy is bound to the same environment name, so the OIDC token exchange only succeeds when the job runs in it. Manage the gate at Settings → Environments → production.

Changelog

See CHANGELOG.md.

License

Apache-2.0

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
1.2.0 786 8/5/2026
1.1.0 129 8/5/2026
1.0.9 1,820 1/23/2024
1.0.8 285 1/23/2024
1.0.7 292 1/23/2024
1.0.6 6,613 2/20/2020
1.0.5 1,273 11/20/2019
1.0.4 2,419 2/19/2019
1.0.3 1,965 6/11/2018
1.0.1 1,649 6/5/2018
1.0.0 1,598 6/1/2018

- migrated to .NET 10 and updated all NuGet packages (Octokit 14, xunit v3)
           - fixed list -s flag (was inverted)
           - deterministic UTC merge header
           - clean CLI error messages with exit code 1
           - GitHub Actions CI/CD replaces Azure DevOps (see CHANGELOG.md)