node package manager
Love JavaScript? Your insights can make it even better. Take the 2017 JavaScript Ecosystem Survey »



Creates an empty git repository, commit/push all changes to the provided git remote/branch.

Getting Started

If you haven't used grunt before, be sure to check out the Getting Started guide.

From the same directory as your project's Gruntfile and package.json, install this plugin with the following command:

npm install grunt-git-init-and-deploy

Once that's done, add this line to your project's Gruntfile:



Inside your Gruntfile.js file add a section named gitInitAndDeploy. This section specifies the options to provide remote repository, branch and commit message.

Config Example

Example to deploy the deploy folder to Heroku:

gitInitAndDeploy: {
    dist: {
        options: {
            repository: '' + process.env.HEROKU_APP_NAME + '.git',
            message: 'deployment for v.' + process.env.BUILD_NUMBER + '-' + process.env.ENVIRONMENT,
            branch: 'master' // optional: default is 'master' 
        src: 'deploy'


Copyright (c) 2013 Juan Pablo Garcia Licensed under the MIT license.