4.0.3 • Published 1 year ago

fie-git v4.0.3

Weekly downloads
32
License
ISC
Repository
github
Last release
1 year ago

fie-git

NPM version David deps Known Vulnerabilities npm download

FIE git tools , base on git-rev-sync

Installation

npm install fie-git --save

API

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

git.status([filePath]) <Object>

return the result of git status --porcelain -b;

{ local_branch: 'xxx',
remote_branch: null,
remote_diff: null,
clean: true/false,
files: []
}

git.repository <Object>

return the result of git config --get remote.origin.url

git.project <Object>

return group/name

git.short([filePath]) <String>

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

git.long([filePath]) <String>

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

git.branch([filePath]) <String>

return the current branch; optional filePath parameter can be used to run the command against a repo outside the current working directory

git.count() <Number>

return the count of commits across all branches; this method will fail if the git command is not found in PATH

git.date() <Date>

returns the date of the current commit; this method will fail if the git command is not found in PATH

git.isTagDirty() <Boolean>

returns true if the current tag is dirty; this method will fail if the git command is not found in PATH

git.message() <String>

return the current commit message; this method will fail if the git command is not found in PATH

git.tag([markDirty]) <String>

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

Support

使用过程中遇到的相关问题,及BUG反馈,可联系: hugohua baofen14787@gmail.com ,也可直接提issues

License

GNU GPLv3