< Back

New-GitHubRepository

Sat Jan 18, 2020 9:39 pm

NAME New-GitHubRepository



SYNOPSIS

Creates a new repository on GitHub.





SYNTAX

New-GitHubRepository [-RepositoryName] <String> [[-OrganizationName] <String>] [[-Description] <String>]

[[-Homepage] <String>] [[-GitIgnoreTemplate] <String>] [[-LicenseTemplate] <String>] [[-TeamId] <Int64>]

[-Private] [-NoIssues] [-NoProjects] [-NoWiki] [-AutoInit] [-DisallowSquashMerge] [-DisallowMergeCommit]

[-DisallowRebaseMerge] [[-AccessToken] <String>] [-NoStatus] [-WhatIf] [-Confirm] [<CommonParameters>]





DESCRIPTION

Creates a new repository on GitHub.



The Git repo for this module can be found here: http://aka.ms/PowerShellForGitHub





PARAMETERS

-RepositoryName <String>

Name of the repository to be created.



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-OrganizationName <String>

Name of the organization that the repository should be created under.

If not specified, will be created under the current user's account.



Required? false

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Description <String>

A short description of the repository.



Required? false

Position? 3

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Homepage <String>

A URL with more information about the repository.



Required? false

Position? 4

Default value

Accept pipeline input? false

Accept wildcard characters? false



-GitIgnoreTemplate <String>

Desired language or platform .gitignore template to apply.

For supported values, call Get-GitHubGitIgnore.

Values are case-sensitive.



Required? false

Position? 5

Default value

Accept pipeline input? false

Accept wildcard characters? false



-LicenseTemplate <String>

Choose an open source license template that best suits your needs.

For supported values, call Get-GitHubLicense

Values are case-sensitive.



Required? false

Position? 6

Default value

Accept pipeline input? false

Accept wildcard characters? false



-TeamId <Int64>

The id of the team that will be granted access to this repository.

This is only valid when creating a repository in an organization.



Required? false

Position? 7

Default value 0

Accept pipeline input? false

Accept wildcard characters? false



-Private [<SwitchParameter>]

By default, this repository will created Public. Specify this to create

a private repository. Creating private repositories requires a paid GitHub account.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-NoIssues [<SwitchParameter>]

By default, this repository will support Issues. Specify this to disable Issues.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-NoProjects [<SwitchParameter>]

By default, this repository will support Projects. Specify this to disable Projects.

If you're creating a repository in an organization that has disabled repository projects,

this will be true by default.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-NoWiki [<SwitchParameter>]

By default, this repository will have a Wiki. Specify this to disable the Wiki.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-AutoInit [<SwitchParameter>]

Specify this to create an initial commit with an empty README.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-DisallowSquashMerge [<SwitchParameter>]

By default, squash-merging pull requests will be allowed.

Specify this to disallow.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-DisallowMergeCommit [<SwitchParameter>]

By default, merging pull requests with a merge commit will be allowed.

Specify this to disallow.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-DisallowRebaseMerge [<SwitchParameter>]

By default, rebase-merge pull requests will be allowed.

Specify this to disallow.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-AccessToken <String>

If provided, this will be used as the AccessToken for authentication with the

REST Api. Otherwise, will attempt to use the configured value or will run unauthenticated.



Required? false

Position? 8

Default value

Accept pipeline input? false

Accept wildcard characters? false



-NoStatus [<SwitchParameter>]

If this switch is specified, long-running commands will run on the main thread

with no commandline status update. When not specified, those commands run in

the background, enabling the command prompt to provide status information.

If not supplied here, the DefaultNoStatus configuration property value will be used.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Confirm [<SwitchParameter>]



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>New-GitHubRepository -RepositoryName MyNewRepo -AutoInit













-------------------------- EXAMPLE 2 --------------------------



PS C:\\>New-GitHubRepository -RepositoryName MyNewRepo -Organization MyOrg -DisallowRebaseMerge















RELATED LINKS