Answer the question
In order to leave comments, you need to log in
How to add a folder from the master branch to gh-pages?
There is npm and bower package. Documentation is generated for it using JSDoc. Docks are saved in the docs folder of the master branch, and of course, the docs folder is specified in .gitignore. I would like, for example, using a bash script to send the docs folder to the gh-pages branch so that the documentation is available online.
I got one gist here , but something is not right ))))
Or maybe there is such a command in git?
Answer the question
In order to leave comments, you need to log in
Thanks everyone, I found this:
#!/bin/sh
branch=$(git rev-parse --abbrev-ref HEAD)
if [ "gh-pages" == "$branch" ]; then
exit
fi
echo Updating gh-pages for branch $branch
git checkout gh-pages
git checkout $branch -- dist
mkdir -p $branch
git rm --ignore-unmatch -rf $branch
mv -f dist/* $branch
git rm -rf --ignore-unmatch dist
git add $branch
git describe --always | git commit -m -
git checkout $branch
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question