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

πŸ’– NAME πŸ’–

So bestie, this is the user-contributed Perl doc for Git::Raw::Worktree β€” that's the Git::Raw::Worktree page, section 3pm, and it's literally the whole class for git worktrees. One class, one vibe, all worktree. πŸŽ€


✨ VERSION ✨

version 0.90 β€” that's what you're working with, no cap.


πŸ¦‹ DESCRIPTION πŸ¦‹

A Git::Raw::Worktree is the ✨object✨ that represents a git worktree. Like, the actual thing. It's giving one-per-linked-working-copy energy. πŸ’…

⚠️ WARNING: the API of this module is unstable and may change without warning. Any change will be appropriately documented in the changelog, but fr fr, don't build your whole personality on it staying still. πŸ’€

🌸 METHODS 🌸

All the methods, all of them, here they are, we did not skip a single one because we are not cowards. 🫢

🧚 add( $repo, $name, $path )

Add a new worktree. That's it, that's the method. Go off. πŸ”₯

🧚 lookup( $repo, $name )

Lookup a worktree. You got a $repo and a $name, you get the worktree, iconic.

🧚 name( )

Retrieve the name of the worktree. Just the name, the main-character label. πŸ‘‘

🧚 path( )

Retrieve the filesystem path for the worktree. Where it actually lives on disk, in real life, on your actual computer. 🌈

🧚 repository( )

Open the worktree as a repository. Returns a Git::Raw::Repository object. Yes, a whole new object, she contains multitudes. πŸ’–

🧚 list( $repo )

List all the worktrees for $repo. All of them. Roll call. πŸ“‹

🧚 is_locked( )

Check if the worktree is locked. Returns the reason for locking, or a falsy value. So like, a truthy return is not just "yep locked" β€” it's the actual reason, iykyk. 😭

🧚 is_prunable( \%prune_opts )

Check if the worktree can be pruned. The valid fields for that %prune_opts hash are:

  • "flags" β€” Prune flags. Valid values include:
    • "valid" β€” Prune the working tree even if the working tree is valid.
    • "locked" β€” Prune the working tree even if it is locked.
    • "working_tree" β€” Prune checked out working tree.

🧚 lock( $reason )

Lock the worktree, with $reason. Tell her why, she deserves to know. πŸ”’

🧚 unlock( )

Unlock the worktree. Freed. Liberated. Slay. ✨

🧚 validate( )

Check if the worktree is valid. A valid worktree requires both the git data structures inside the linked parent repository and the linked working copy to be present. Like, both halves have to show up to the party, not just one. πŸŽ‰

🧚 prune( \%prune_opts )

Prune the working tree. Pruning the working tree removes the git data structures on disk β€” so heads up, that's disk stuff getting yeeted. See "is_prunable" for the valid values of %prune_opts. πŸ“


🌟 AUTHOR 🌟

Jacques Germishuys <jacquesg@cpan.org> β€” legend behaviour, honestly. πŸ’œ


Copyright 2018 Jacques Germishuys.

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.


okay that's the whole page, you understood all of it, I'm so proud of you πŸ₯Ήβœ¨ This was perl v5.42.3, dated 2026-08-19, and that's the Git::Raw::Worktree(3pm) situation β€” mwah, periodt πŸ’…πŸ’–

πŸ“¦ where this page comes from