Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Merge pull request #320 from cironunes/gh-pages-fix
fix gh-pages to stash and don't delete files.
- Loading branch information
Showing
1 changed file
with
18 additions
and
9 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,21 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo 'setting up gh-pages' | ||
git symbolic-ref HEAD refs/heads/gh-pages \ | ||
&& rm .git/index \ | ||
&& git clean -fdx \ | ||
&& echo 'My Page' > index.html \ | ||
&& git add . \ | ||
&& git commit -a -m 'Initial commit' \ | ||
&& git push -u origin gh-pages \ | ||
&& git fetch origin \ | ||
&& echo 'complete' | ||
echo '-------------------' | ||
|
||
echo 'Tell me your github account username: ' | ||
read username | ||
|
||
echo 'Now, tell me your repository name: ' | ||
read repository | ||
|
||
git stash \ | ||
&& git checkout -b 'gh-pages' \ | ||
&& echo 'My Page' > index.html \ | ||
&& git add . \ | ||
&& git commit -a -m 'Initial commit' \ | ||
&& git remote add origin https://github.com/"$username"/"$repository".git \ | ||
&& git push -u origin gh-pages \ | ||
&& echo 'Complete' \ | ||
&& echo '-------------------' \ | ||
&& echo 'You can find your last changes in the stash!' |