This project was used to my knowledge as a fix to ensure that we could run this package on Azure. As we use GCP and we experienced errors using this package on windows locally (Due to or fork changes), this project is here only due to legacy reasons.
If something is causing a hickup with this project it might be due to me mergin the latest changes of the package from the last 2 years - please try using the release v1.7.1 or other in this project.
- Johan Westerlund 2019-02-27
Synchronously get the current git commit hash, tag, count, branch or commit message. Forked from git-rev.
var git = require('git-rev-sync');
console.log(git.short());
// 75bf4ee
console.log(git.long());
// 75bf4eea9aa1a7fd6505d0d0aa43105feafa92ef
console.log(git.branch());
// master
You can also run these examples via: npm run examples
npm install git-rev-sync --save
var git = require('git-rev-sync');
return the result of git rev-parse --short HEAD
- optional
filePath
parameter can be used to run the command against a repo outside the current working directory - optional
length
parameter can be used to set the desired hash length (defaults to7
)
return the result of git rev-parse HEAD
; optional filePath
parameter can be used to run the command against a repo outside the current working directory
return the current branch; optional filePath
parameter can be used to run the command against a repo outside the current working directory
return the count of commits across all branches; this method will fail if the git
command is not found in PATH
returns the date of the current commit; this method will fail if the git
command is not found in PATH
returns true if there are uncommitted changes; this method will fail if the git
command is not found in PATH
returns true if the current tag is dirty; this method will fail if the git
command is not found in PATH
return the current commit message; this method will fail if the git
command is not found in PATH
return the current remote URL; this method will fail if the git
command is not found in PATH
return the current tag and mark as dirty if markDirty is truthful; this method will fail if the git
command is not found in PATH