https://github.com/sheerun/git-commit-id
Returns commit id (commit sha) of git repository. Useful for Next.js or Sentry.
https://github.com/sheerun/git-commit-id
git nextjs sentry webpack
Last synced: 11 months ago
JSON representation
Returns commit id (commit sha) of git repository. Useful for Next.js or Sentry.
- Host: GitHub
- URL: https://github.com/sheerun/git-commit-id
- Owner: sheerun
- License: mit
- Created: 2019-09-19T22:05:04.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T22:01:20.000Z (over 3 years ago)
- Last Synced: 2025-03-19T07:37:17.405Z (over 1 year ago)
- Topics: git, nextjs, sentry, webpack
- Language: JavaScript
- Homepage:
- Size: 497 KB
- Stars: 6
- Watchers: 2
- Forks: 1
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# git-commit-id [](https://travis-ci.org/sheerun/git-commit-id) [](https://github.com/sheerun/modern-node)
> Returns commit id (commit sha) of git repository
This package is fast, has no dependencies, has synchronous API, doesn't require git binary.
Useful e.g. for CI, release for [Sentry](https://github.com/getsentry/sentry-webpack-plugin) or build id for [Next.js](https://github.com/zeit/next.js#configuring-the-build-id)
## Installation
```
yarn add --dev git-commit-id
```
> If you're using [npm](https://www.npmjs.com/) you can use: `npm install --save-dev git-commit-id`.
## Usage
```js
const gitCommitId = require('git-commit-id')
const commitId = gitCommitId()
```
### Custom directory
You can pass `cwd` option to specify custom git directory:
```js
const commitId = gitCommitId({ cwd: __dirname })
```
## License
MIT