🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

git-branch-name

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

git-branch-name

get the directory's git branchName

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

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

Keywords

git

FAQs

Package last updated on 28 Jun 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts