Method: Git::Base#current_branch

Defined in:
lib/git/base.rb

#current_branchString

The name of the branch HEAD refers to or 'HEAD' if detached

Returns one of the following:

  • The branch name that HEAD refers to (even if it is an unborn branch)
  • 'HEAD' if in a detached HEAD state

Returns:

  • (String)

    the name of the branch HEAD refers to or 'HEAD' if detached

[View source]

691
692
693
# File 'lib/git/base.rb', line 691

def current_branch
  self.lib.branch_current
end