From c8717df44a2be7f58a23b0142d62c600c8676349 Mon Sep 17 00:00:00 2001 From: Scott Date: Wed, 2 Sep 2026 11:18:36 +1000 Subject: [PATCH] docs(git-provider): Document Remove-GitRepoRegistration --- docs/GitRepositoryRegistration.md | 39 ++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/docs/GitRepositoryRegistration.md b/docs/GitRepositoryRegistration.md index cbea932..d679505 100644 --- a/docs/GitRepositoryRegistration.md +++ b/docs/GitRepositoryRegistration.md @@ -82,4 +82,41 @@ PS C:/> ## Remove-GitRepoRegistration -`Remove-GitRepoRegistration [-Name string]` \ No newline at end of file +`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. +``` \ No newline at end of file