feat: Add GitRepoRegistration cmdlets #5

Merged
pascal_nulah merged 69 commits from feature/git-provider into dev 2026-09-06 09:33:36 +10:00
Showing only changes of commit c8717df44a - Show all commits

docs(git-provider): Document Remove-GitRepoRegistration

Scott 2026-09-02 11:18:36 +10:00

View file

@ -82,4 +82,41 @@ PS C:/>
## Remove-GitRepoRegistration
`Remove-GitRepoRegistration [-Name string]`
`Remove-GitRepoRegistration [-Name string]`
Removes a repo registration by the given name, or if no name is specified, attempts to remove the git repo registered by resolving the git repo.
If `Name` is not provided then the command must be run in a location that is a git repo and the registration to remove will use the parent git repo folder name. If `Name` _is_ provided this command can be executed from any location.
```pwsh
# Default registration without a name within a folder in a git repo
PS D:/Repos/Project-a> New-GitRepoRegistration
# List registrations
PS D:/Repos/Project-a> Get-GitRepoRegistration
Name Location CurrentBranch
---- -------- -------------
Project-a D:/Repos/Project-a main
Test-Repo D:/Repos/Project-a main
# Remove a registration from within a git repo
PS D:/Repos/Project-a> Remove-GitRepoRegistration
# No output indicates successful removal
PS D:/Repos/Project-a> Get-GitRepoRegistration
Name Location CurrentBranch
---- -------- -------------
Test-Repo D:/Repos/Project-a main
# Duplicate calls error if there is no registration
PS D:/Repos/Project-a> Remove-GitRepoRegistration
Remove-GitRepoRegistration: No registration exists for 'Project-a'.
# Debug output via named argument
PS D:/Repos/Project-a> Remove-GitRepoRegistration -name Test-Repo -debug
DEBUG: Checking if current directory is a git repository...
DEBUG: ...location is a git repo!
DEBUG: Removed Test-Repo.
```