Home > Net >  Show the commit history for a specific tag using the simple-git library
Show the commit history for a specific tag using the simple-git library

Time:12-22

How to show the commit history for a specific tag using the simple-git library.

Type 'boolean' is not assignable to type 'OptionsValues'.
const log = await git.log({
  'v1.0.0': true
});
git tag
v1.0.0
v1.0.1
v1.0.2
v1.0.3
v1.1.0

Trying to get the time and date of the git tags.

Basically, I want the equivalent of this git command in simple-git.

git log -1 --format=%ai v1.0.0

CodePudding user response:

Here's an example of how you can do this:

const simpleGit = require('simple-git/promise');

async function main() {
  const git = simpleGit();
  const log = await git.log(['-1', '--format=%ai', 'v1.0.0']);
  console.log(log);
}

main();
  • Related