A set of git tools based on A successful Git branching model
- Start and finish a feature, release and hotfix branch.
- Bump the version number.
- Create a tag for release and hotfix.
- Remove path from git history.
- Be sure you have a clean tree before running gitf.
- When started will create the develop branch for you if doesn't exist.
- Uses the package.json to manage versions, folowing Semantic Versioning.
To install gitf globaly run
npm install gitf -gor to install localy
npm install gitf --save-devUse gitf in the command line or in node.
gitf --helppathstringclearScreenBooleancallbackFunction
const Gitf = require('gitf')
const gitf = new Gitf({
path: './',
clearScreen: true
}, callback)Create a feature branch from develop.
gitf create-feature experimentbranchNamestringcallbackFunction
gitf.run('create-feature' 'experiment', callback)Merge the feature branch in develop and delete the feature branch.
gitf finish-feature experimentbranchNamestringcallbackFunction
gitf.run('finish-feature' 'experiment', callback)Bump version, tag commit and create a release branch from develop.
gitf create-release minorreleasestring minor majorcallbackFunction
gitf.run('create-release' 'minor', callback)Bump version and merge the release branch with develop.
gitf finish-release 0.1releaseNumberstringcallbackFunction
gitf.run('finish-release' '0.1', callback)Create a hotfix branch from a release branch.
gitf create-hotfix 0.1releaseNumberstringcallbackFunction
gitf.run('create-hotfix' '0.1', callback)Bump version, tag commit and merge the hotfix branch with release branch.
gitf finish-hotfix 0.1.1hotfixNumberstringcallbackFunction
gitf.run('finish-hotfix' '0.1.1', callback)Remove a path from git history for a specific branch.
gitf remove-path path/to/remove masterpathstringbranchNamestringcallbackFunction
gitf.run('remove-path' 'path/to/remove', 'master', callback)git checkout -b feature-* developgit checkout develop
git merge feature-*
git branch -d feature-*git checkout develop
git commit -a -m "bumped version number to release-*.*.*-rc.1"
git tag release-*.*.*-rc.1
git checkout -b release-*.* developBump version number in package.json after checkout develop
git checkout develop
git merge release-*.*git checkout -b hotfix-*.*.* release-*.*git commit -a -m "bumped version number to *.*.*"
git tag *.*.*
git checkout release-*
git merge hotfix-*
git branch -d hotfix-*git checkout *
git filter-branch --tree-filter 'rm -rf *' --prune-empty HEAD &&
git for-each-ref --format="%(refname)" refs/original/ | xargs -n 1 git update-ref -d &&
git gcTest
The unit test are written in Mocha.
Please add a unit test for every new feature or bug fix. npm test will run the tests.
Documentation
Please add documentation for every API change.
Feel free to contribute!
Copyright (c) 2017 Bruno Santos Licensed under the MIT license.