Let's say I have a master
branch and a gh-pages
branch. The directory structure for master looks like this:
projects/
project-one/
src/
app.js
dist/
bundle.js
index.html
project-two/
src/
app.js
dist/
bundle.js
index.html
The directory structure for gh-pages
is blank, but I want it to look like this:
project-one/
bundle.js
index.html
project-two/
bundle.js
index.html
I've tried instructions detailed here
$ git checkout master
$ git checkout gh-pages project-one/dist
error
$ git checkout gh-pages -- project-one/dist
error
That should copy the dist folder into the gh-pages
branch but I get a error pathspec: file not found
error so I tried git pull
to sync to the remote, but this does not solve the problem.
Note that in order to make gh-pages
clean I used git rm -r
on the whole directory because I do not want gh-pages
directory structure to be inherited from master
.
How can I copy everything in each project/dist folder from the master branch into the gh-pages branch?
edit: tried git checkout gh-pages project-one/dist/**
which gave me a better error msg: error: pathspec 'dist/bundle.js' did not match any file(s) known to git.