Last active
February 13, 2018 13:15
-
-
Save felixexter/a9697bb8deab65431249 to your computer and use it in GitHub Desktop.
Заливка файлов в ветку gh-pages из произвольной папки и ветки
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Заливка файлов в ветку 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