File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ #
3+
4+ WORKING_BRANCH=$( git branch | grep -E " \* " | cut -d \ -f 2)
5+ if [ " $WORKING_BRANCH " = " gh-pages" ]; then
6+ git commit -am " publishing to gh-pages branch"
7+ git push origin gh-pages
8+ else
9+ echo " You're in $WORKING_BRANCH branch"
10+ echo " You need to pull in changes to the gh-pages branch to publish"
11+ read -p " process Y/n " YES_NO
12+ if [ " $YES_NO " = " Y" ] || [ " $YES_NO " = " y" ]; then
13+ echo " Committing and pushing to $WORKING_BRANCH "
14+ git commit -am " commiting to $WORKING_BRANCH "
15+ git push origin " $WORKING_BRANCH "
16+ echo " Changing branchs from $WORKING_BRANCH to gh-pages"
17+ git checkout gh-pages
18+ echo " Merging changes from origin gh-pages"
19+ git pull origin gh-pages
20+ git commit -am " merging origin gh-pages"
21+ echo " Pulling changes from $WORKING_BRANCH info gh-pages"
22+ git pull origin " $WORKING_BRANCH "
23+ echo " Merging changes from $WORKING_BRANCH "
24+ git commit -am " merging $WORKING_BRANCH with gh-pages"
25+ echo " Pushing changes up and publishing"
26+ git push origin gh-pages
27+ echo " Changing back to your working branch $WORKING_BRANCH "
28+ git checkout " $WORKING_BRANCH "
29+ fi
30+ fi
You can’t perform that action at this time.
0 commit comments