Skip to content

Move-GitHubRepository

SYNOPSIS

Transfer a repository

SYNTAX

Move-GitHubRepository [-Owner] <String> [-Name] <String> [-NewOwner] <String> [[-NewName] <String>]
 [[-TeamIds] <Int32[]>] [[-Context] <Object>] [-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTION

A transfer request will need to be accepted by the new owner when transferring a personal repository to another user. The response will contain the original owner, and the transfer will continue asynchronously. For more details on the requirements to transfer personal and organization-owned repositories, see about repository transfers. You must use a personal access token (classic) or an OAuth token for this endpoint. An installation access token or a fine-grained personal access token cannot be used because they are only granted access to a single account.

EXAMPLES

EXAMPLE 1

Move-GitHubRepository -Owner 'PSModule' -Name 'GitHub' -NewOwner 'GitHub' -NewName 'PowerShell'

Moves the GitHub repository to the PSModule organization and renames it to GitHub.

PARAMETERS

-Owner

The account owner of the repository. The name is not case sensitive.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Name

The name of the repository without the .git extension. The name is not case sensitive.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-NewOwner

The username or organization name the repository will be transferred to.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-NewName

The new name to be given to the repository.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 4
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-TeamIds

ID of the team or teams to add to the repository. Teams can only be added to organization-owned repositories.

Type: Int32[]
Parameter Sets: (All)
Aliases:

Required: False
Position: 5
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Context

The context to run the command in. Used to get the details for the API call. Can be either a string or a GitHubContext object.

Type: Object
Parameter Sets: (All)
Aliases:

Required: False
Position: 6
Default value: (Get-GitHubContext)
Accept pipeline input: False
Accept wildcard characters: False

-ProgressAction

{{ Fill ProgressAction Description }}

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

GitHubRepository

NOTES

https://psmodule.io/GitHub/Functions/Repositories/Move-GitHubRepository/

[Transfer a repository](https://docs.github.com/rest/repos/repos#transfer-a-repository)