Skip to content

Instantly share code, notes, and snippets.

@felixexter
Last active February 13, 2018 13:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save felixexter/a9697bb8deab65431249 to your computer and use it in GitHub Desktop.
Save felixexter/a9697bb8deab65431249 to your computer and use it in GitHub Desktop.
Заливка файлов в ветку gh-pages из произвольной папки и ветки
# Заливка файлов в ветку gh-pages из произвольной папки и ветки
# Команда: gh-pages <branch> <path/to/folder>
# Пример: gh-pages master dist
gh-pages() {
if [[ $1 && $2 ]]; then
git checkout gh-pages
git checkout $1 -- .gitignore
rm -rf `ls | grep -v node_modules`
git checkout $1 -- $2
mv $2/* .
rm -rf $2
git add --all
git status
git commit -m Updated.
git push origin gh-pages
git checkout $1
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment