Git::Wrapper::Plus::Ref::Branch - A Branch object
version 0.004011
use Git::Wrapper::Plus::Ref::Branch; my $branch = Git::Wrapper::Plus::Ref::Branch->new( git => $git_wrapper, name => 'master' ); $branch->refname # refs/heads/master $branch->sha1 # deadbeefbadf00da55c0ffee $branch->delete # git branch -d master $branch->delete({ force => 1 }); # git branch -D master $branch->move('alternative'); # git branch -m master alternative $branch->move('alternative', { force => 1 }); # git branch -M master alternative
new_from_Ref
Convert a Plus::Ref to a Plus::Ref::Branch
my $branch_object = $class->new_from_Ref( $ref_object );
refname
Returns name, in the form refs/heads/<name>
name
refs/heads/<name>
sha1
Returns the SHA1 of the branch tip.
SHA1
delete
$branch->delete(); # git branch -d $branch->name $branch->delete({ force => 1 }); # git branch -D $branch->name
Note: $branch will of course still exist after this step.
$branch
move
$branch->move($new_name); # git branch -m $branch->name, $new_name $branch->move($new_name, { force => 1 }); # git branch -M $branch->name $new_name
Note: $branch will of course, still exist after this step
Kent Fredric <kentnl@cpan.org>
This software is copyright (c) 2017 by Kent Fredric <kentfredric@gmail.com>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Git::Wrapper::Plus, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Git::Wrapper::Plus
CPAN shell
perl -MCPAN -e shell install Git::Wrapper::Plus
For more information on module installation, please visit the detailed CPAN module installation guide.