https://github.com/aichbauer/node-tagged-git-commits
Get the commit hash and refs/tag of tagged commits, remote and local
https://github.com/aichbauer/node-tagged-git-commits
commit git git-tags is-git nodejs repo tag
Last synced: about 1 year ago
JSON representation
Get the commit hash and refs/tag of tagged commits, remote and local
- Host: GitHub
- URL: https://github.com/aichbauer/node-tagged-git-commits
- Owner: aichbauer
- License: mit
- Created: 2017-07-02T09:07:19.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2020-07-28T05:27:59.000Z (almost 6 years ago)
- Last Synced: 2025-03-22T19:49:30.716Z (about 1 year ago)
- Topics: commit, git, git-tags, is-git, nodejs, repo, tag
- Language: JavaScript
- Homepage:
- Size: 47.9 KB
- Stars: 1
- Watchers: 2
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# tagged-git-commits
Get the commit hash and refs/tags of tagged commits, remote and local
[](https://travis-ci.org/aichbauer/node-tagged-git-commits)
[](https://ci.appveyor.com/project/aichbauer/node-tagged-git-commits/branch/master)
[](https://coveralls.io/github/aichbauer/node-tagged-git-commits?branch=master)
## Installation
```sh
$ npm i tagged-git-commits --save
```
or
```sh
$ yarn add tagged-git-commits
```
## Usage
```js
const taggedCommits = require('tagged-git-commits');
// the latest local tagged commit from process.cwd()
taggedCommits();
// the latest local tagged commit from the repo './path/to/repo'
taggedCommits({
path: './path/to/repo',
});
// the latest 5 local tagged commits 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 commits from the repo './path/to/repo' from the remote origin
taggedCommits({
path: './path/to/repo',
lookBehind: 3,
local: false,
remote: 'origin',
});
```
Returns an Array with objects.
```js
[
{
commit: '31107b9051efe17e57c583937e027993860b11a9',
shortCommit: '31107b9',
hash: '31107b9051efe17e57c583937e027993860b11a9',
shortHash: '31107b9',
version: 'v1.0.0',
refsTags: 'refs/tags/v1.0.0',
},
]
```
## LICENSE
MIT © Lukas Aichbauer