git-branch-name

1.1.0 • Public • Published

git-branch-name Build Status Coverage Status

Get the directory's git branchName by nodejs, support git submodule

Install

npm install git-branch-name --save

Use

var getGitBranchName = require('git-branch-name');
 
var dirPath = path.resolve(__dirname, '../');
 
getGitBranchName(dirPath, function(err, branchName) {
  
  console.log(branchName); // master
 
});

How

Parse the output of git branch --work-tree=dirPath --git-dit=dirPath/.git

License

MIT © 2015 sobear

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.0
    1,853
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.1.0
    1,853
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i git-branch-name

Weekly Downloads

1,853

Version

1.1.0

License

MIT

Last publish

Collaborators

  • sobear