Class: Git::Lib::HeadState
- Inherits:
-
Struct
- Object
- Struct
- Git::Lib::HeadState
- Defined in:
- lib/git/lib.rb
Overview
The state and name of branch pointed to by HEAD
HEAD can be in the following states:
:active: HEAD
points to a branch reference which in turn points to a
commit representing the tip of that branch. This is the typical state when
working on a branch.
:unborn: HEAD
points to a branch reference that does not yet exist
because no commits have been made on that branch. This state occurs in two
scenarios:
- When a repository is newly initialized, and no commits have been made on the initial branch.
- When a new branch is created using
git checkout --orphan <branch>
, starting a new branch with no history.
:detached: HEAD
points directly to a specific commit (identified by its
SHA) rather than a branch reference. This state occurs when you check out a
commit, a tag, or any state that is not directly associated with a branch. The
branch name in this case is HEAD
.
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#state ⇒ Object
Returns the value of attribute state.