Skip to content

Instantly share code, notes, and snippets.

@athoune
Last active May 24, 2025 09:34
Show Gist options
  • Save athoune/d65178ee6f904f1cf34fce1206b10c84 to your computer and use it in GitHub Desktop.
Save athoune/d65178ee6f904f1cf34fce1206b10c84 to your computer and use it in GitHub Desktop.
Craft your own github pages

Github-pages "à la mimine" (handcrafted)

Initialize web branch

bob@local:~$ cd /tmp
bob@local:/tmp$ git clone [email protected]:bob/proj.git proj-web
bob@local:/tmp$ cd proj-web
bob@local:/tmp/proj-web$ git checkout --orphan gh-pages
bob@local:/tmp/proj-web$ git reset --hard

Oups, rebuild web folder

bob@local:~$ cd /tmp
bob@local:/tmp$ git clone [email protected]:bob/proj.git proj-web
bob@local:/tmp$ cd proj-web
bob@local:/tmp/proj-web$ git switch gh-pages

Write some HTML

bob@local:/tmp/proj-web$ echo "<h1>Yeahhh</h1>" > index.html

Publish

bob@local:/tmp/proj-web$ git add .
bob@local:/tmp/proj-web$ git commit -m "Dummy web page"
bob@local:/tmp/proj-web$ git push origin gh-pages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment