Git::R...ference(3pm)

πŸ’– Git::Raw::Reference β€” the manual, but make it bestie πŸ’–

okay so welcome to the Git::Raw::Reference page, part of the User Contributed Perl Documentation (that's the 3pm section, iykyk). Grab a boba, we're learning about git refs πŸ§‹βœ¨

✨ NAME ✨

Git::Raw::Reference β€” it's the git reference class, babes πŸ’…

🌸 VERSION 🌸

version 0.90 πŸŽ€

πŸ¦‹ DESCRIPTION πŸ¦‹

A Git::Raw::Reference represents a Git reference. that's the whole vibe. a ref. a little pointer with a name. iconic behavior honestly πŸ‘‘

⚠️ WARNING: the API of this module is unstable and may change without warning (any change will be appropriately documented in the changelog). so like… don't get too attached to the exact shape of things, bestie 😭 it's giving "we'll text you if anything changes"

πŸ’… METHODS πŸ’…

annotated_commit( )

Create a Git::Raw::AnnotatedCommit from the reference. yes queen, make it annotated ✨

lookup( $name, $repo )

Retrieve the reference with name $name in $repo. go find it, it's right there 🫢

create( $name, $repo, $object [, $force, $symbolic] )

Creates and returns a new reference named $name in $repo, pointing to $object. building a ref from scratch, we love a creation story 🌈

  • $object can be a Git::Raw::Blob, Git::Raw::Commit, or a Git::Raw::Tree object. those are your options, no cap 🌸
  • if $force is a truthy value, any existing reference is overwritten. bold. dramatic. slay πŸ’€
  • if $force is falsy (this is the default, btw), and a reference named $name already exists, an error is thrown. so like… it will absolutely yell at you 🚨
  • if $symbolic is a truthy value, then a symbolic reference is created ✨
  • if $symbolic is falsy (also the default), then a direct reference is created 🎯
  • if $symbolic is a truthy value, then $object can be a Git::Raw::Reference or a string. yes, a string. fr fr πŸ”₯

delete( )

Delete the reference.

🚫 do not access the Git::Raw::Reference object afterwards. it's gone. deceased. not coming back. bestie is not okay πŸ’€

name( )

Retrieve the name of the reference. just the name, nothing extra, we're being efficient πŸ’…

shorthand( )

Get the reference's short name. This will transform the reference name into a "human-readable" version. If no shortname is appropriate, it will return the full name.

basically: it tries to be cute and casual, and if it can't, it just gives you the whole government name πŸ™ˆ

type( )

Retrieve the type of the reference. Can be either "direct" or "symbolic". pick a lane bestie ✨

target( [$new_target] )

Retrieve the target of the reference. If the $new_target parameter β€” of type Git::Raw::Reference β€” is passed in, the reference will be changed to point to it. so you can read it or redirect it, versatile queen πŸ‘‘

⚠️ Note that updating the target will invalidate all existing handles to the reference. every old handle? invalidated. gone. rip 😭

This function returns either an object (Git::Raw::Blob, Git::Raw::Commit, Git::Raw::Tag or Git::Raw::Tree) for direct references, or another reference for symbolic references. two very different energy readings, honestly 🌈

peel( $type )

Recursively peel the reference until an object of the specified $type is found. Valid values for $type include: "commit", "tree" or "tag".

peel it like an orange until you hit the layer you actually wanted 🍊✨

reflog( )

Retrieve the Git::Raw::Reflog of the reference. Shortcut for Git::Raw::Reflog->open(). a little shortcut, a lil convenience moment πŸŽ€

owner( )

Retrieve the Git::Raw::Repository owning the reference. who's your parent? who's your keeper? πŸ‘‘

is_branch( )

Check if the reference is a branch. 🌿

is_remote( )

Check if the reference is remote. πŸ“‘

is_tag( )

Check if the reference lives in the "refs/tags" namespace. 🏷️

is_note( )

Check if the reference lives in the "refs/notes" namespace. πŸ“


πŸ‘‘ AUTHOR πŸ‘‘

  • Alessandro Ghedini <alexbio@cpan.org>
  • Jacques Germishuys <jacquesg@cpan.org>

legends, both of them πŸ’œ

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 page, bestie!! this was perl v5.42.3, dated 2026-08-19, and it lives in the Git::R...ference(3pm) manual. mwah πŸ’‹ go build something iconic with your refs, no cap πŸ«Άβœ¨πŸ’…

πŸ“¦ where this page comes from