Skip to content

Instantly share code, notes, and snippets.

@diogomoretti
Created February 5, 2014 00:53
Show Gist options
  • Save diogomoretti/8815503 to your computer and use it in GitHub Desktop.
Save diogomoretti/8815503 to your computer and use it in GitHub Desktop.
"gh-pages" branch as subfolder in github
# 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 git@github.com: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 git@github.com:johndoe/project.git .
git checkout -b gh-pages
# Ignore the warning. Get rid of master, leaving gh-branches.
git branch -d master
@diogomoretti
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment