1.0.0 • Published 7 years ago
tagged-git-commit v1.0.0
tagged-git-commit
Get the commit hash and refs/tag of tagged commits, remote and local
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
1.0.0
7 years ago