Skip to content

Instantly share code, notes, and snippets.

@tuttelikz
Created April 29, 2018 03:59
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 tuttelikz/ebb42bc369da3ce3f2bc00e344a228ad to your computer and use it in GitHub Desktop.
Save tuttelikz/ebb42bc369da3ce3f2bc00e344a228ad to your computer and use it in GitHub Desktop.
This is a simple procedure how one can create gh-pages branch on newly created repository
# Github's web hosting looks for a branch called "gh-pages"
# Git by names the default branch "master" so we must rename
# it to "gh-pages" so that Github can find the website files.
# In terminal/cmd
#############################################################
mkdir YOUR_REPO.github.com
cd YOUR_REPO.github.com
echo "# hello Sanzhar" >> README.md
git init
git checkout -b gh-pages
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/YOUR-USER/YOUR-REPO.git
git push origin gh-pages
#############################################################
# Now if you check on github you should only leave with gh-pages branch
Settings (Repo settings) --> Branches --> Default Branch --> gh-pages --> Update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment