JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 99753
  • Score
    100M100P100Q152547F
  • License

Get the current branch for a local git repository.

Package Exports

  • git-branch

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (git-branch) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

git-branch NPM version

Get the current branch for a local git repository.

Install with npm

npm i git-branch --save

Usage

var branch = require('git-branch');

// async
branch(function (err, res) {
  //=> 'master'
});

// sync
branch.sync();
//=> 'master'
  • parse-git-config: Parse .git/config into a JavaScript object. sync or async.
  • git-username: Get the username from a git remote origin URL.
  • git-user-name: Get a user's name from git config at the project or global scope, depending on what git uses in the current context.
  • git-repo-name: Get the repository name from the git remote origin URL.

Running tests

Install dev dependencies.

npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue

Author

Jon Schlinkert

License

Copyright (c) 2015 Jon Schlinkert
Released under the MIT license


This file was generated by verb-cli on March 09, 2015.