Skip to content
Get the git commithash within a Range from-to
JavaScript
Branch: master
Clone or download
This branch is 4 commits behind aichbauer:master.

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
test/fixtures/repo-ten-commits/git
.babelrc
.eslintrc
.gitignore
.npmignore
.travis.yml
CHANGELOG.md
LICENSE
README.md
appveyor.yml
index.js
package.json
test.js
yarn.lock

README.md

git-commit-range

Build Status Build status Coverage Status

Get the git commithash within a Range from-to

Installation

$ npm i git-commit-range --save

or

$ yarn add git-commit-range

Usage

Returns an array with the commithashes from a specified commit to another specified commit.

const gitCommitRange = require('git-commit-range');

gitCommitRange(); // returns all commits (complete hash) since the beginning of the repo of process.cwd()

gitCommitRange({
  path: 'my/repo',
  from: '15be93c31ad87c9ced03ba0b60fc2fb55c977c5c',
  to: '32b940b014322834966d79b109d2d7adec8e3ea3',
  include: false,
}); // returns all commits (complete hash) between from and to EXCLUDING from and to, of the path 'my/repo'

gitCommitRange({
  path: 'my/repo',
  from: '15be93c31ad87c9ced03ba0b60fc2fb55c977c5c',
  to: '32b940b014322834966d79b109d2d7adec8e3ea3',
}); // returns all commits (complete hash) between from and to INCLUDING from and to, of the path 'my/repo'

gitCommitRange({
  path: 'my/repo',
  from: '15be93c31ad87c9ced03ba0b60fc2fb55c977c5c',
  to: '32b940b014322834966d79b109d2d7adec8e3ea3',
  short: true,
}); // returns all commits (short hash) between from and to INCLUDING from and to, of the path 'my/repo'

LICENSE

MIT © Lukas Aichbauer

You can’t perform that action at this time.