dotnet-ignore
1.2.0
dotnet tool install --global dotnet-ignore --version 1.2.0
dotnet new tool-manifest
dotnet tool install --local dotnet-ignore --version 1.2.0
#tool dotnet:?package=dotnet-ignore&version=1.2.0
nuke :add-package dotnet-ignore --version 1.2.0
dotnet-ignore
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:
- Prepare the release PR: bump
<Version>insrc/CliTool/CliTool.csprojand add a CHANGELOG.md entry. - Merge the PR to
master. Thepublishworkflow starts and waits for approval. - Approve the run: Actions → the
publishrun → 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
productionenvironment, which already lists you as a required reviewer and allowsmasteras 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
| Product | Versions 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. |
This package has no dependencies.
- 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)