Scroll to navigation

Dist::Zilla::Plugin::Git::Init(3pm) User Contributed Perl Documentation Dist::Zilla::Plugin::Git::Init(3pm)

NAME

Dist::Zilla::Plugin::Git::Init - Initialize git repository on dzil new

VERSION

version 2.049

SYNOPSIS

In your profile.ini:

    [Git::Init]
    commit_message = initial commit  ; this is the default
    stage = 1                        ; this is the default
    commit = 1                       ; this is the default
    branch =                         ; this is the default (uses init.defaultBranch config)
    remote = origin https://github.com/USERNAME/%N.git ; no default
    push_url = origin git@github.com:USERNAME/%{lc}N.git ; no default
    config = user.email USERID@cpan.org  ; there is no default

DESCRIPTION

This plugin initializes a git repository when a new distribution is created with "dzil new".

Plugin options

The plugin accepts the following options:

  • commit_message - the commit message to use when checking in the newly-minted dist. Defaults to "initial commit".
  • stage - if true (the default), stage (add to Git index) all files in the newly-minted dist directory. If commit option is true and stage is false, Git will create an empty commit. An empty commit is a valid commit and can be used as the first commit (root commit) in a repository.
  • commit - if true (the default), commit the newly-minted dist. If set to a false value, add the files to the Git index but don't actually make a commit.
  • branch - the branch name under which the newly-minted dist is checked in (if "commit" is true). Defaults to an empty string, which means that the Git default branch is used (whatever you have configured in `git config init.defaultBranch`).
  • config - a config setting to make in the repository. No config entries are made by default. A setting is specified as "OPTION VALUE". This may be specified multiple times to add multiple entries.
  • remote - a remote to add to the repository. No remotes are added by default. A remote is specified as "NAME URL". This may be specified multiple times to add multiple remotes.
  • push_url - the URL to use to push to a particular remote to add to the repository. No URLs are added by default. A remote is specified as "NAME URL". This may be specified multiple times to specify push URLs for multiple remotes, and is not required if the URL is the same as the one already set for that remote.

    Per the documentation for git-remote(1): Note that the push_url and the corresponding URL specified with "remote", even though they can be set differently, must still refer to the same place. What you pushed to the push URL should be what you would see if you immediately fetched from the fetch URL (the URL specified with "remote".) If you are trying to fetch from one place (e.g. your upstream) and push to another (e.g. your publishing repository), use two separate remotes.

    This, therefore, is best used in cases where pushing requires authentication, but pulling does not, or if pulling is via git or ssh, but pushing is via https, on the same repository.

Formatting options

You can use the following codes in "commit_message", "config", "remote", or "push_url":

%n
A newline.
%N
The distribution name. You can also use "%{lc}N" or "%{uc}N" to get the name in lower case or upper case, respectively.

SUPPORT

Bugs may be submitted through the RT bug tracker <https://rt.cpan.org/Public/Dist/Display.html?Name=Dist-Zilla-Plugin-Git> (or bug-Dist-Zilla-Plugin-Git@rt.cpan.org <mailto:bug-Dist-Zilla-Plugin-Git@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" <irc://irc.perl.org/#distzilla>.

AUTHOR

Jerome Quelin

COPYRIGHT AND LICENCE

This software is copyright (c) 2009 by Jerome Quelin.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

2024-01-20 perl v5.38.2