user1853128
user1853128

Reputation: 1114

Update the folder of GIT with the latest values

    gitclone: {
      autojqm: {
        options: {
          repository: "https://github.com/imaginethepoet/autojqm"
          branch: "master"
          directory: "repo"
        }
      },
      otherrepo: {
        options: {
          repository: "https://example.com/anotherrepository"
          branch: "master"
          directory: "anotherfolder"
        }
      }
    }

grunt.loadNpmTasks('grunt-git');

    grunt.task.registerTask('gitclone', function() {
        if (this.name=="gitclone"){
            grunt.log.writeln("Hurray");
            gitmerge: {
                your_target: {
                    options: {
                        repository: "https://github.com/imaginethepoet/autojqm"
                        branch :"master"
                        directory:"anotherfolder"
                    }
                }
            }
        }
        else{
            grunt.log.writeln("OOps");
        }
    });


    grunt.registerTask('default', ['gitclone']);

I am trying to access the folder which is already pulled from GIT, and I am just trying to override that folder with the newer values which have been added. But I am not unable to get my folder up to date. Can anyone help me out.

Upvotes: 1

Views: 141

Answers (1)

Remco Haszing
Remco Haszing

Reputation: 7809

Just add another target. The following example is plain old JavaScript, but I'm sure you can change it to coffee:

gitclone: {
  autojqm: {
    options: {
      repository: "https://github.com/imaginethepoet/autojqm"
      branch: "master"
      directory: "repo"
    }
  },
  otherrepo: {
    options: {
      repository: "https://example.com/anotherrepository"
      branch: "master"
      directory: "anotherfolder"
    }
  }
}

Upvotes: 1

Related Questions