tagged-git-commit

1.0.0 • Public • Published

tagged-git-commit

Get the commit hash and refs/tag of tagged commits, remote and local

Build Status Build status Coverage Status

Installation

$ npm i tagged-git-commit --save

or

$ yarn add tagged-git-commit

Usage

Returns an array of the commit hashes.

const taggedCommits = require('tagged-git-commit');
 
// the latest local tagged commit hash from process.cwd()
taggedCommits();
 
// the latest local tagged commit hash from the repo './path/to/repo'
taggedCommits({
  path: '.path/to/repo',
});
 
// the latest 5 local tagged commit hashes from process.cwd()
taggedCommits({
  lookBehind: 5,
});
 
// the latest tagged commit from process.cwd() from remote origin
taggedCommits({
  local: false,
});
 
// the latest tagged commit from process.cwd() from remote anotherOrigin
taggedCommits({
  local: false,
  remote: 'anotherOrigin'
});
 
// the latest 3 tagged commit hashes from the repo './path/to/repo' from the remote origin
taggedCommits({
  path: './path/to/repo',
  lookBehind: 3,
  local: false,
  remote: 'origin',
});

LICENSE

MIT © Lukas Aichbauer

Package Sidebar

Install

npm i tagged-git-commit

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • aichbauer