grunt-gh-pages icon indicating copy to clipboard operation
grunt-gh-pages copied to clipboard

How to copy to root

Open bsides opened this issue 10 years ago • 6 comments

Hi,

I'm trying to get this tool to copy everything from my project's ./dist folder to the git clone gh-pages but I want all the files from the dist folder only. From what I understood, this is the default config:

        'gh-pages': {
          options: {
            base: 'dist',
          },
          src: '**'
        },

What I understood is that with this config everything from "dist" will be copied to a new branch called "gh-pages" with only the things in dist. What is happening is that it's copying the whole project into this branch and not only this folder... am I missing something?

Thanks in advance!

bsides avatar May 13 '14 22:05 bsides

@bsides what version of grunt and grunt-gh-pages are you using?

Let me know if this config works for you:

grunt.initConfig({
  'gh-pages': {
    options: {
      base: 'dist'
    },
    all: {
      src: ['**']
    }
  }
});

tschaub avatar May 14 '14 05:05 tschaub

Didn't work either, but worry not - I just used git for it:

git subtree push --prefix dist origin gh-pages

With this command it will push just the dist folder into the branch gh-pages. I even put it on my .gitconfig file to make it faster:

gh = "! f() { git subtree push --prefix $1 origin gh-pages; }; f"

This way I just call git gh dist and it's done :smile_cat:

bsides avatar May 14 '14 16:05 bsides

grunt.initConfig({
  'gh-pages': {
    options: {
      base: 'dist'
    },
    all: {
      src: ['**']
    }
  }
});

This worked for me.

steveoh avatar Dec 09 '14 18:12 steveoh

It didn't work twice though. Running grunt gh-pages-clean helped though.

steveoh avatar Dec 09 '14 19:12 steveoh

Same issue as @steveoh, worked the first time but not the second.

ty- avatar Feb 25 '15 14:02 ty-

I believe I have a similar problem, but none of the solutions helped. My file structure is like this:

.
├── ...
└── dist
    ├── file1
    └── file2

I want the following to be published to GitHub pages:

.
├── file1
└── file2

Whichever option I try, the output is always put inside dist and not at the root of the repo, i.e.:

.
└── dist
    ├── file1
    └── file2

Any ideas?

stanch avatar Mar 15 '15 17:03 stanch