git, github gh-pages and static websites

16
Git, GitHub and gh-pages Central California Java User Group 03/11/2016, Bitwise South Stadium, Fresno, CA Csaba Toth

Upload: csaba-toth

Post on 26-Jan-2017

278 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: Git, GitHub gh-pages and static websites

Git, GitHub and gh-pages

Central California Java User Group

03/11/2016, Bitwise South Stadium, Fresno, CA

Csaba Toth

Page 2: Git, GitHub gh-pages and static websites

About me Csaba Toth [email protected],@tocsa2

LinkedIn: http://www.linkedin.com/in/csabatothdev Polyglot full-stack developer (C++, Java, C#, Python) Full time remote developer of SportsBoard (WestShore Tech is

located in Sausalito, CA), living in Fresno, CA Plus has a consulting company Co-founder of Nashville JUG Founder of Central California JUG

Page 3: Git, GitHub gh-pages and static websites

Agenda Version control systems Distributed version control systems (vs centralized) Git GitHub gh-pages (Jekyll)

Page 4: Git, GitHub gh-pages and static websites

Version Control systems

Page 5: Git, GitHub gh-pages and static websites

Branching strategies

Page 6: Git, GitHub gh-pages and static websites

Branching strategies

Page 7: Git, GitHub gh-pages and static websites

Hosting static site on GitHub Perfect for static Twitter Bootstrap sketches Example: http://dealoround.com GitHub’s convention: gh-pages branch. Source

https://github.com/MrCsabaToth/DealORoundWebsite/tree/gh-pages

-> Site: https://mrcsabatoth.github.io/DealORoundWebsite

Page 8: Git, GitHub gh-pages and static websites

Hosting static site on GitHub Perfect for static Twitter Bootstrap sketches Example: http://dealoround.com GitHub’s convention: gh-pages branch. Source:

https://github.com/MrCsabaToth/DealORoundWebsite/tree/gh-pages

-> Site: https://mrcsabatoth.github.io/DealORoundWebsite

Page 9: Git, GitHub gh-pages and static websites

Hosting static site on GitHub Perfect for static Twitter Bootstrap sketches Example: http://dealoround.com GitHub’s convention: gh-pages branch. Source:

https://github.com/whateverify/Awesomeness/tree/gh-pages

-> Site: https://WhatEverify.github.io/Awesomeness

Page 10: Git, GitHub gh-pages and static websites

Steps http://blog.teamtreehouse.com/using-github-pages-to-host-your-

website

1. Create new repo

2. Add gh-pages branch

3. Pick Bootstrap template and customize or use Jekyll to generate site

4. Commit the site to the gh-pages branch

Page 11: Git, GitHub gh-pages and static websites

Hosting static site on BitBucket Similar steps for BitBucket (+ can have 5 private repos for free!)

http://www.techrepublic.com/article/host-static-websites-for-free-with-bitbuckets-git-feature/

Any source commit means immediate effective deployment too Simple and easy to use You have automatic source tracking

Page 12: Git, GitHub gh-pages and static websites

Hosting static site from Git repo Leverage features of Git repo sites (issue tracking, etc) You can register a custom domain name and set the CNAME for

the DNS record Favicon There’s NO database backend and NO application server (PHP,

Java, ASP.NET)! You can also leverage Google Drive, but you will only have

limited change tracking

Page 13: Git, GitHub gh-pages and static websites

Hosting static site from Git repo Leverage features of Git repo sites (issue tracking, etc) You can register a custom domain name and set the CNAME for

the DNS record Favicon There’s NO database backend and NO application server (PHP,

Java, ASP.NET)! You can also leverage Google Drive, but you will only have

limited change tracking

Page 14: Git, GitHub gh-pages and static websites

Special: personal website Another naming convention: when you name the repository like

“username.gtihub.io”, this signals to GitHub that you want to serve that repository as a static website when someone visits username.gtihub.io

In that special case the repository shouldn’t be in the gh-pages branch, but it has to be in the master branch

Page 15: Git, GitHub gh-pages and static websites

Static websites examples One extra, which uses Google Maps and Synfusion’s radial

context menus: https://mrcsabatoth.github.io/RottenApples/ https://github.com/MrCsabaToth/RottenApples

Page 16: Git, GitHub gh-pages and static websites

Thanks for listening Questions?

Csaba Toth Download: http://www.slideshare.net/tothc http://www.linkedin.com/in/csabatothdev