3.0.5 • Published 7 months ago

@crossan007/git-last-commit v3.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

git-last-commit

Node.js module to read last git commit information including tags and branch - mostly to be used by continuous integration and build systems for build tagging purposes.

Usage

var git = require('git-last-commit');

git.getRepoInfo(function(err, commit) {
  // read commit object properties
  console.log(commit);
});

Function returns an object like this:

{
  commit: {
    "shortHash": "d2346fa",
    "hash": "d2346faac31de5e954ef5f6baf31babcd3e899f2",
    "subject": "initial commit",
    "sanitizedSubject": "initial-commit",
    "body": "this is the body of the commit message",
    "authoredOn": "1437988060",
    "committedOn": "1437988060",
    "author": {
      "name": "Ozan Seymen",
      "email": "oseymen@gmail.com"
    },
    "committer": {
      "name": "Ozan Seymen",
      "email": "oseymen@gmail.com"
    },
    "notes": "commit notes"
  },
  head: "master",
  tags: ['R1', 'R2']
}

You can add path destination if you want to get git last commit information on another repository:

var git = require('git-last-commit');

git.getLastCommit(function(err, commit) {
  // read commit object properties
  console.log(commit);
}, {dst: 'some/other/path'});
3.0.4

7 months ago

3.0.3

7 months ago

3.0.5

7 months ago

3.0.2

2 years ago

3.0.1

2 years ago

3.0.0

2 years ago

2.1.1

2 years ago

2.1.0

2 years ago

2.0.4

2 years ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago