class Git::Branch

Represents a Git branch

Branch objects provide access to branch metadata and operations like checkout, delete, and merge. They should be obtained via {Git::Repository#branch} or {Git::Repository#branches}, not constructed directly.

@example Getting a branch

git = Git.open('.')
branch = git.branch('main')
branch.checkout

@example Listing branches

git.branches.each { |b| puts b.name }

@api public