rubenv / grunt-git

Git commands for grunt.
MIT License
227 stars 83 forks source link

Warning: Task "grunt-git" not found. Use --force to continue. #100

Closed jeremypbeasley closed 9 years ago

jeremypbeasley commented 9 years ago

I've followed the steps of setup here and all seem straightforward. I've been using grunt efficiently for 6 months and have never had an issue like this.

I installed using the right commands and it still seems to not be able to find the task. Any help?

Here's my command line log:

Last login: Sat Feb 7 21:05:49 on ttys000 USSEBJEBEASLMBP:~ jebeasley$ cd /build/goodcorps_ss/ USSEBJEBEASLMBP:goodcorps_ss jebeasley$ grunt Warning: Task "grunt-git" not found. Use --force to continue.

Aborted due to warnings. USSEBJEBEASLMBP:goodcorps_ss jebeasley$ npm install grunt-git --save-dev npm WARN package.json goodcorps@0.1.0 No description npm WARN package.json goodcorps@0.1.0 No README data grunt-git@0.3.3 node_modules/grunt-git └── flopmang@0.0.1 (underscore@1.7.0, underscore.string@2.4.0) USSEBJEBEASLMBP:goodcorps_ss jebeasley$ grunt Warning: Task "grunt-git" not found. Use --force to continue.

Aborted due to warnings. USSEBJEBEASLMBP:goodcorps_ss jebeasley$

Here's my exact gruntfile.js

module.exports = function ( grunt ) {

"use strict";

// Default project paths.
var pubRoot = ".",

    sassRoot = "./sass",
    cssRoot = "./sqs_template/styles",
    fontsRoot = "./sqs_template/assets/fonts",
    imgRoot = "./sqs_template/assets/images",

    jsRoot = "./js",
    appRoot = jsRoot + "/app",
    libRoot = jsRoot + "/lib",
    distRoot = "sqs_template/scripts";

// Project configuration.
grunt.initConfig({
    // Project meta.
    meta: {
        version: "0.1.0"
    },

    stylus: {
        options: {
            'compress': false,
            'include css': true
        },
        compile: {
            files: {
              'sqs_template/styles/screen.less': 'styles/master.styl',
            }
        }
    },

    watch: {
        scripts: {
            files: ['Gruntfile.js', 'styles/*.styl'],
            tasks: ['concat', 'stylus'],
            options: {
                spawn: false
            },
        } 
    },

    gitcommit: {
        your_target: {
            options: {
                cwd: "https://bsley@bitbucket.org/bsley/testing123.git",
                message: 'Testing 123',
            },
            files: [
                {
                    src: ["sqs_template/*.*","sqs_template/*/*.*","sqs_template/*/*/*.*","sqs_template/*/*/*/*.*"],
                    cwd: "sqs_template"
                }
            ]
        }
    },

});

// Load the nautilus plugin.
// grunt.loadNpmTasks( "grunt-nautilus" );

grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-stylus');
grunt.loadNpmTasks('grunt-git');

// Register default task.
// grunt.registerTask( "default", ["nautilus:build"] );
grunt.registerTask('default', ['grunt-git','stylus','watch']);

};

dylancwood commented 9 years ago

Hi,

it looks like you're referring to a task called grunt-git on the last line of your Gruntfile. There is no task called grunt-git in your config: the task you want is called gitcommit. Here's the offending line:


grunt.registerTask('default', ['grunt-git','stylus','watch']);

should be


grunt.registerTask('default', ['gitcommit','stylus','watch']);

The reason is that grunt-git registers many sub-tasks (gitcommit, gitpull, etc...). You need to refer to the actual subtasks.