Exploring with assumed changes
--assume-changes replaces the Git diff entirely: the projects you name are treated as changed, and the graph is
walked from there. Nothing on disk is touched, and no Git comparison happens.
dotnet affected describe --assume-changes DotnetAffected.Core1 files have changed referenced by 1 projects0 NuGet Packages have changed5 projects are affected by these changes0 projects were excludedChanged ProjectsName PathDotnetAffected.Core /repo/src/DotnetAffected.Core/DotnetAffected.Core.csproj
Affected ProjectsName Pathdotnet-affected /repo/src/dotnet-affected/dotnet-affected.csprojdotnet-affected.Benchmarks /repo/benchmarks/dotnet-affected.Benchmarks/dotnet-affected.Benchmarks.csprojdotnet-affected.Tests /repo/test/dotnet-affected.Tests/dotnet-affected.Tests.csprojDotnetAffected.Core.Tests /repo/test/DotnetAffected.Core.Tests/DotnetAffected.Core.Tests.csprojDotnetAffected.Tasks /repo/src/DotnetAffected.Tasks/DotnetAffected.Tasks.csprojThat answers “if I touch this, what has to be rebuilt?” before you touch it.
How projects are matched
Section titled “How projects are matched”Each value is resolved against the project graph and matches when any of these holds:
- it equals the project’s full path — absolute, or relative to
--repository-path; - it equals the project’s
ProjectNameproperty, case-insensitively; - it equals the project file’s name without extension, case-insensitively.
# By namedotnet affected --assume-changes DotnetAffected.Core
# By path relative to the repositorydotnet affected --assume-changes src/DotnetAffected.Core/DotnetAffected.Core.csproj
# Several at oncedotnet affected --assume-changes DotnetAffected.Core dotnet-affectedCombining with other options
Section titled “Combining with other options”--assume-changes overrides change detection, so --from and --uncommitted have no effect alongside it. Everything else
still applies: --exclude-output filters the result, --format and --output-name control what gets written, and
--dry-run keeps it all on stdout.
dotnet affected --dry-run --assume-changes DotnetAffected.Core --exclude-output '\.Benchmarks\.csproj$'