Task to synchronize two directories. Similar to grunt-copy but updates only files that have been changed.

npm install grunt-sync
313 downloads in the last day
1 357 downloads in the last week
6 021 downloads in the last month


A grunt task to keep directories in sync. It is very similar to grunt-contrib-copy but tries to copy only those files that has actually changed.


npm install grunt-sync --save

Within your grunt file:


    sync: {
      main: {
        files: [{
          cwd: 'src',
          src: [
            '**', /* Include everything */
            '!**/*.txt' /* but exclude txt files */
          dest: 'bin',
        verbose: true // Display log messages when copying files


  grunt.registerTask('default', 'sync');

More examples

sync: {
  main: {
    files: [
      {src: ['path/**'], dest: 'dest/'}, // includes files in path and its subdirs
      {cwd: 'path/', src: ['**/*.js', '**/*.css'], dest: 'dest/'}, // makes all src relative to cwd
    verbose: true


Task does not remove any files and directories in dest that are no longer in src.

npm loves you