Unless I’m just not seeing it, I do not see an API call within the Git class to return the current branch. Is there a way to accomplish this currently or is in in the pipeline for later?
While there isn’t a function, there appears to be a property:
git = atom.project.getRepo() console.log(git.branch) # => "refs/heads/master"
The current API documentation for the most part doesn’t account for properties or events.