Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to copy to root #34

Open
bsides opened this issue May 13, 2014 · 6 comments
Open

How to copy to root #34

bsides opened this issue May 13, 2014 · 6 comments

Comments

@bsides
Copy link

bsides commented May 13, 2014

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!

@tschaub
Copy link
Owner

tschaub commented May 14, 2014

@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: ['**']
    }
  }
});

@bsides
Copy link
Author

bsides commented May 14, 2014

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 😸

@steveoh
Copy link

steveoh commented Dec 9, 2014

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

This worked for me.

@steveoh
Copy link

steveoh commented Dec 9, 2014

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

@ty-
Copy link

ty- commented Feb 25, 2015

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

@stanch
Copy link

stanch commented Mar 15, 2015

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants