Last active
December 16, 2015 16:10
-
-
Save greatghoul/5461633 to your computer and use it in GitHub Desktop.
ghp-import <dirname>
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
@echo off | |
title Deploying gh-pages ... | |
if "%1" == "" goto help | |
if "%1" == ".git" ( | |
echo Warning: Can not publish .git directory | |
goto end | |
) | |
if not exist %1 ( | |
echo Directory "%1" not found. | |
goto end | |
) | |
echo Creating gh-pages with directory: %1 | |
git branch -q -D gh-pages | |
git checkout -q --orphan gh-pages | |
git rm -r -q --cached . | |
for /f %%G in ('dir /b .') do ( if not "%%G" == "%1" if not "%%G" == ".git" del /S /F /Q %%G > nul ) | |
move /Y %1\* . > nul | |
rd /S /Q %1 > nul | |
git add . | |
git commit -m "First Commit" | |
echo Deploying gh-pages to github pages | |
git push --force origin gh-pages | |
git checkout -q -f master | |
echo Everyting is done. | |
goto end | |
:help | |
echo ghp-import ^<dirname^> | |
goto end | |
:end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment