In general, you should run it when code is ready for release and working directory is clean
By default, it
- bumps patch verion number within
package.json
file - commits being changed
package.json
file to local git repository - creates tag by using bumped version number to local git repository
- pushes local changes to remote branch
{
"repository": {
"type": "git",
"url": "https://github.com/cloudchen/test-grunt-bump.git"
}
}
Let grunt bump
task know where upstream is.
This can also be used to avoid warnning with npm install
or npm update
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
...
bump: {
options: {
pushTo: '<%=pkg.repository.url%>'
}
}
...
});
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
...
bump: {
options: {
push: false,
pushTo: '<%=pkg.repository.url%>'
}
}
...
});
grunt bump:patch
# equals to
grunt bump
grunt bump:minor
grunt bump:major