Skip to content

Instantly share code, notes, and snippets.

@greatghoul
Last active December 16, 2015 16:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save greatghoul/5461633 to your computer and use it in GitHub Desktop.
Save greatghoul/5461633 to your computer and use it in GitHub Desktop.
ghp-import <dirname>
@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