Git::Raw::Branch(3pm)
๐ Git::Raw::Branch โ the branch class, bestie ๐
okay so this is the page for Git::Raw::Branch(3pm) from the User Contributed Perl Documentation, and I'm gonna walk you through it like we're texting at 2am. stay with me, it's actually so good.
โจ NAME โจ
Git::Raw::Branch โ it's the Git branch class, periodt. ๐ธ
๐ VERSION ๐
version 0.90 โ yes she's got a number and yes she's proud of it ๐
โญ SYNOPSIS โญ
okay first of all, look at her:
use Git::Raw;
# open the Git repository at $path
my $repo = Git::Raw::Repository -> open($path);
# create a new branch named 'some_branch'
$repo -> branch('some_branch', $repo -> head -> target);
so you use Git::Raw, you open the repo at $path, and then boom โ you make a new branch called 'some_branch' by pointing it at $repo -> head -> target. that's it. that's the whole vibe. ๐ฆ
๐ DESCRIPTION ๐
She's a helper class for branch manipulation, and here's the iconic part: a Git branch is literally nothing more than a Git::Raw::Reference, so this class inherits all methods from it. like, all of them. she's got the family genes. ๐
WARNING ๐จ the API of this module is unstable and may change without warning. (any change will be appropriately documented in the changelog, bestie โ they're not gonna ghost you, it's fine.) but fr fr, don't build your whole personality on it staying the same.
๐ METHODS ๐
๐ธ create( $repo, $name, $target )
Create a new branch, given a name and a target object. And that target has to be either a Git::Raw::Commit or a Git::Raw::Tag โ no substitutions, iykyk. โจ
๐ฆ lookup( $repo, $name, $is_local )
Retrieve the branch that corresponds to the branch name you passed in. ๐
๐
move( $name, $force )
Rename the branch to $name. okay but here's the tea she wants you to know: in order to get the updated branch object, you need an additional Git::Raw::Branch->lookup(). she doesn't just hand it to you, you gotta go get it yourself. ๐
๐ upstream( [$upstream] )
Retrieve or set the reference supporting the remote tracking branch, given the local branch. if there's no corresponding supporting reference, this function returns undef โ she's not gonna pretend. ๐ญ
$upstream can be one of three things:
- a
Git::Raw::Reference - a string containing the upstream reference name
undef
and if you set $upstream to undef? the remote tracking branch association is removed. gone. deleted. no notes. ๐
๐ upstream_name( )
Return the name of the reference supporting the remote tracking branch, given the the local branch. (yes, the doubled "the the" is in the original and I love her for it, no cap.) if there's no associated remote tracking branch, this returns undef. ๐
๐ remote_name( )
Return the name of the remote that the remote tracking branch belongs to, given the local branch. if there's no associated remote tracking branch, this returns undef. same energy, different question. ๐ง
โญ is_head( )
Check if the current local branch is pointed at by HEAD. the main character check. the vibe check. ๐
๐ AUTHOR ๐
- Alessandro Ghedini
<alexbio@cpan.org> - Jacques Germishuys
<jacquesg@cpan.org>
two legends, we stan ๐ซถ
๐ LICENSE AND COPYRIGHT ๐
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.
and that's the whole page bestie, we ate and left no crumbs ๐ธ๐ โจ
this was Git::Raw::Branch(3pm) โ perl v5.42.3, dated 2026-08-19. signing off, go make some branches, mwah ๐๐ฎ๐
๐ฆ where this page comes from
- ubuntu stonking: libgit-raw-perl 0.90+ds-3build3 ยท Artistic-1.0-Perl OR GPL-1.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms