Nulah.PowerShell/docs/GitRepositoryRegistration.md

1.7 KiB

Git Repo Registration

  • all commands support -debug

New-GitRepoRegistration

New-GitRepoRegistration [-Name string]

Creates a new registration for the current directory, optionally registering against the given name. If -Name is not given the folder for the root level of the git repo will be used.

Name registrations are not case-sensitive, so registrations can be made using different cases for the same location, and multiple registrations can exist for the git repository.

# Default registration 
PS D:/Repos/Project-a> New-GitRepoRegistration -debug
DEBUG: Checking if current directory is a git repository...
DEBUG: ...location is a git repo!
DEBUG: No name given for registration, defaulting to git folder root.
DEBUG: Registered 'D:/Repos/Project-a' to name 'Project-a'

# Named registration 
PS D:/Repos/Project-a> New-GitRepoRegistration "test repo" -debug
DEBUG: Checking if current directory is a git repository...
DEBUG: ...location is a git repo!
DEBUG: Registered 'D:/Repos/Project-a' to name 'test repo'

PS D:/Repos/Project-a> Get-GitRepoRegistration

Name         Location              CurrentBranch
----         --------              -------------
test-repo    D:/Repos/Project-a    main
Project-a    D:/Repos/Project-a    main

If the current directory is not in a git repo, a registration already exists by name or default folder, or if any other issue occurs such as git not being available an error will be thrown.

Get-GitRepoRegistration

Get-GitRepoRegistration

Show-GitRepoRegistration

Show-GitRepoRegistration -Name string [-NoStack|-NoSetLocation]

Remove-GitRepoRegistration

Remove-GitRepoRegistration [-Name string]