Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/AArnott/DotNetRepoTools
A CLI tool with commands to help maintain .NET codebases
https://github.com/AArnott/DotNetRepoTools
Last synced: 7 days ago
JSON representation
A CLI tool with commands to help maintain .NET codebases
- Host: GitHub
- URL: https://github.com/AArnott/DotNetRepoTools
- Owner: AArnott
- License: mit
- Created: 2023-03-02T18:10:03.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-08T16:44:02.000Z (4 months ago)
- Last Synced: 2024-07-08T21:10:28.512Z (4 months ago)
- Language: C#
- Size: 793 KB
- Stars: 13
- Watchers: 3
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Nerdbank.DotNetRepoTools
***A CLI toolbox for repo maintenance***
[![NuGet package](https://img.shields.io/nuget/v/Nerdbank.DotNetRepoTools.svg)](https://www.nuget.org/packages/Nerdbank.DotNetRepoTools)
[![NuGet prerelease](https://img.shields.io/badge/nuget-CI-blue)](https://dev.azure.com/andrewarnott/OSS/_artifacts/feed/PublicCI/NuGet/Nerdbank.DotNetRepoTools)[![Build Status](https://dev.azure.com/andrewarnott/OSS/_apis/build/status/DotNetRepoTools/DotNetRepoTools?branchName=main)](https://dev.azure.com/andrewarnott/OSS/_build/latest?definitionId=74&branchName=main)
## Usage
### Acquisition
Install or upgrade this tool with the following command:
dotnet tool update -g Nerdbank.DotNetRepoTools
Install or upgrade to the latest CI build with the following command:
dotnet tool update -g Nerdbank.DotNetRepoTools --prerelease --add-source https://pkgs.dev.azure.com/andrewarnott/OSS/_packaging/PublicCI/nuget/v3/index.json
## Commands
After install, use the tool name `repo` to run commands.
This CLI tool has (or will have) a variety of commands and sub-commands, discoverable using the `-h` switch to discover commands, sub-commands, and switches.
```
$ repo -?Description:
A CLI tool with commands to help maintain .NET codebases.Usage:
repotools [command] [options]Options:
--version Show version information
-?, -h, --help Show help and usage informationCommands:
nuget NuGet maintenance commands
git Git repo maintenance workflows
```You can then drill in to reveal sub-commands:
```
$ repo nuget -?Description:
NuGet maintenance commandsUsage:
repotools nuget [command] [options]Options:
-?, -h, --help Show help and usage informationCommands:
reconcile-versions Resolves all package downgrade warnings.
upgrade Upgrade a package dependency, and all transitive dependencies such that no package downgrade warnings occur.
trim Removes PackageReference items that are redundant because they are to packages that already appear as transitive
dependencies.
ManagePackageVersionsCentrally Migrates a repo to use centralized package versions.
```and
```
$ repo git -?Description:
Git repo maintenance workflowsUsage:
repotools git [command] [options]Options:
-?, -h, --help Show help and usage informationCommands:
trim Removes local branches that have already been merged into some target ref.
```## Example usage
For example, the following command will upgrade the repo's Directory.Packages.props file to consume a new version of a particular package,
and update all transitive dependencies that also have versions specified in that file, so that you do not have to manually upgrade those versions
to resolve package downgrade errors:repo nuget upgrade StreamJsonRpc 1.2.3
Or the command I use most frequently, which cleans up all your stale local branches:
repo git trim origin/main