↩︎

async-git

👾 Retrieve data from current git repository

* Properties are async (getters) more on async properties

const git = require('async-git');

`${await git.author} committed ${await git.message}` // Omri committed Some changes

Properties

Property Type Description Example
name String Project name await git.name
branch String Current branch name await git.branch
author String Author name of the last commit await git.author
comitter String Comitter name of the last commit await git.comitter
email String Author email of the last commit await git.email
sha String Unique identifier of the last commit await git.sha
short String 7 Character Unique identifier of the last commit await git.short
message String Most recent commit full message (subject and body) await git.message
subject String Most recent commit subject await git.subject
body String Most recent commit message body await git.body
date Date Date of the last change await git.date

Functions

Function Parameters Description Example
tag {String} version Create a tag using the last commit message await git.tag('1.2.3')
reset {String} State ID Reset current HEAD to the specified state await git.reset('f5db755')
modified {String} [Path to file] Get the last modified date of a file