Module: Git::Commands::SymbolicRef Private

Defined in:
lib/git/commands/symbolic_ref.rb,
lib/git/commands/symbolic_ref/read.rb,
lib/git/commands/symbolic_ref/delete.rb,
lib/git/commands/symbolic_ref/update.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Commands for reading, updating, and deleting symbolic refs via git symbolic-ref

This module contains command classes split by invocation mode:

  • Read — read the target of a symbolic ref
  • Update — create or update a symbolic ref to point at a given branch
  • Delete — delete a symbolic ref

Examples:

Read the current HEAD

cmd = Git::Commands::SymbolicRef::Read.new(lib)
cmd.call('HEAD')

Update HEAD to point to a branch

cmd = Git::Commands::SymbolicRef::Update.new(lib)
cmd.call('HEAD', 'refs/heads/main')

Delete a symbolic ref

cmd = Git::Commands::SymbolicRef::Delete.new(lib)
cmd.call('HEAD')

See Also:

Defined Under Namespace

Classes: Delete, Read, Update