Git::Raw::Remote - Git remote class
version 0.23
use Git::Raw; # open the Git repository at $path my $repo = Git::Raw::Repository -> open($path); # add a new remote my $remote = Git::Raw::Remote -> create($repo, 'origin', $url); # set the acquire credentials callback $remote -> cred_acquire(sub { Git::Raw::Cred -> plaintext($usr, $pwd) }); # connect the remote $remote -> connect('fetch'); # fetch from the remote and update the local tips $remote -> download; $remote -> update_tips; # disconnect $remote -> disconnect;
A Git::Raw::Remote represents a Git remote.
Git::Raw::Remote
WARNING: The API of this module is unstable and may change without warning (any change will be appropriately documented in the changelog).
Create a remote with the default fetch refspec and add it to the repository's configuration.
Retrieve the name of the remote. If $name is passed, the remote's name will be updated and returned.
$name
Retrieve the URL of the remote. If $url is passed, the remote's URL will be updated and returned.
$url
Retrieve the fetchspec of the remote. If $spec is passed, the remote's fetchspec will be updated and returned.
$spec
Retrieve the pushspec of the remote. If $spec is passed, the remote's pushspec will be updated and returned.
Run $callback any time authentication is required to connect to the remote repository. The callback receives a string containing the URL of the remote, and it must return a Git::Raw::Cred object.
Connect to the remote. The direction can be either "fetch" or "push".
"fetch"
"push"
Disconnect the remote.
Download the remote packfile.
Save the remote to its repository's config.
Update the tips to the new status.
Check if the remote is connected.
Alessandro Ghedini <alexbio@cpan.org>
Copyright 2012 Alessandro Ghedini.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install Git::Raw, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Git::Raw
CPAN shell
perl -MCPAN -e shell install Git::Raw
For more information on module installation, please visit the detailed CPAN module installation guide.