Created
February 5, 2014 00:53
-
-
Save diogomoretti/8815503 to your computer and use it in GitHub Desktop.
"gh-pages" branch as subfolder in github
This file contains 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
# Make your gitHub project. | |
mkdir project | |
cd project/ | |
git init | |
echo "# Project README file" > README.markdown | |
git add . | |
git commit -m "Project README added" | |
git remote add origin [email protected]:johndoe/project.git | |
git push origin master | |
# Make a new dist directory, and tell git to ignore it. | |
mkdir dist | |
echo "dist/" > .gitignore | |
git add . | |
git commit -m ".gitignore dist/ folder (contains gh-pages branch)" | |
git push origin master | |
# Clone the whole project (master+gh-branch) into a new subdirectory | |
cd dist/ | |
git clone [email protected]:johndoe/project.git . | |
git checkout -b gh-pages | |
# Ignore the warning. Get rid of master, leaving gh-branches. | |
git branch -d master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Demo: github.com/diogomoretti/project-test