NAME
Dist::Zilla::Plugin::GitHub::Create - Create a new GitHub repo on dzil new
VERSION
version 0.49
SYNOPSIS
Configure git with your GitHub credentials:
$ git config --global github.user LoginName
$ git config --global github.password GitHubPassword
Alternatively you can install Config::Identity and write your credentials in the (optionally GPG-encrypted) ~/.github
file as follows:
login LoginName
password GitHubpassword
(if only the login name is set, the password will be asked interactively)
then, in your profile.ini:
# default config
[GitHub::Create]
# to override publicness
[GitHub::Create]
public = 0
# use a template for the repository name
[GitHub::Create]
repo = {{ lc $dist->name }}
See "ATTRIBUTES" for more options.
DESCRIPTION
This Dist::Zilla plugin creates a new git repository on GitHub.com when a new distribution is created with dzil new
.
It will also add a new git remote pointing to the newly created GitHub repository's private URL. See "ADDING REMOTE" for more info.
ATTRIBUTES
repo
-
Specifies the name of the GitHub repository to be created (by default the name of the dist is used). This can be a template, so something like the following will work:
repo = {{ lc $dist->name }}
org
-
Specifies the name of a GitHub organization in which to create the repository (by default the repository is created in the user's account).
prompt
-
Prompt for confirmation before creating a GitHub repository if this option is set to true (default is false).
public
-
Create a public repository if this option is set to true (default), otherwise create a private repository.
remote
-
Specifies the git remote name to be added (default 'origin'). This will point to the newly created GitHub repository's private URL. See "ADDING REMOTE" for more info.
has_issues
-
Enable issues for the new repository if this option is set to true (default).
has_wiki
-
Enable the wiki for the new repository if this option is set to true (default).
has_downloads
-
Enable downloads for the new repository if this option is set to true (default).
prompt_2fa
-
Prompt for GitHub two-factor authentication code if this option is set to true (default is false). If this option is set to false but GitHub requires 2fa for the login, it'll be automatically enabled.
ADDING REMOTE
By default GitHub::Create
adds a new git remote pointing to the newly created GitHub repository's private URL if, and only if, a git repository has already been initialized, and if the remote doesn't already exist in that repository.
To take full advantage of this feature you should use, along with GitHub::Create
, the Dist::Zilla::Plugin::Git::Init plugin, leaving blank its remote
option, as follows:
[Git::Init]
; here goes your Git::Init config, remember
; to not set the 'remote' option
[GitHub::Create]
You may set your preferred remote name, by setting the remote
option of the GitHub::Create
plugin, as follows:
[Git::Init]
[GitHub::Create]
remote = myremote
Remember to put [Git::Init]
before [GitHub::Create]
.
After the new remote is added, the current branch will track it, unless remote tracking for the branch was already set. This may allow one to use the Dist::Zilla::Plugin::Git::Push plugin without the need to do a git push
between the dzil new
and dzil release
. Note though that this will work only when the push.default
Git configuration option is set to either upstream
or simple
(which will be the default in Git 2.0). If you are using an older Git or don't want to change your config, you may want to have a look at Dist::Zilla::Plugin::Git::PushInitial.
SUPPORT
Bugs may be submitted through the RT bug tracker (or bug-Dist-Zilla-Plugin-GitHub@rt.cpan.org).
There is also a mailing list available for users of this distribution, at http://dzil.org/#mailing-list.
There is also an irc channel available for users of this distribution, at #distzilla
on irc.perl.org
.
AUTHOR
Alessandro Ghedini <alexbio@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2011 by Alessandro Ghedini.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.