A git tool for grunt
Get git commit id
This plugin requires Grunt ~0.4.0
First of all, you need to install this plugin by npm,
npm install grunt-git-rev-parse --save-dev
And second, you need to load this task in your grunt file.
grunt.loadNpmTasks('grunt-git-rev-parse');
In your project's Gruntfile, add a section named git-rev-parse
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
"git-rev-parse": {
"options": {
// Task-specific options go here.
}
},
})
Type: String
Default value: ''
A string value that is used as a property name for storing the result of this task
Type: Number
Default value: 6
The number of SHA1 value. Under the hood, this is the 'number' of git command --short=[number]
Type: Boolean
Default value: false
If true the task will not print the result on success. Error-messages will still be printed.
Inspired by Mikael Karon grunt-git-describe