Last active
August 29, 2015 14:04
-
-
Save anistark/f59a99c05db41666a537 to your computer and use it in GitHub Desktop.
Github Pages
This file contains hidden or 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
To get started with gh-pages, you should know what gh-pages is first. If you know, proceed here.. | |
Supposing you already have a git repo open on your terminal with the default branch, master | |
To switch to a new branch, gh-pages: | |
git checkout --orphan gh-pages | |
--orphan creates a branch gh-pages with no parent. | |
Now you would wanna remove all files from the old working tree: | |
git rm -rf . | |
Now, you are in gh-pages branch and you have an empty repo. | |
Create a file, say index.html | |
Write a few html codes in it. And then push it: | |
git push origin gh-pages | |
Now, you're page would be displayed on [yourusername].github.io/reponame | |
In case you might wanna switch back to your master branch: | |
git checkout master | |
Deleting a local branch | |
git branch -D <branchname> | |
Deleting from remote branch | |
git push origin --delete <branchname> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment