-
-
Save androide-osorio/296a72732a42e85f5aadea3f1d5c95c6 to your computer and use it in GitHub Desktop.
Revisions
-
Coby Chapple revised this gist
Mar 4, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ # Deploying a subfolder to GitHub Pages Sometimes you want to have a subdirectory on the `master` branch be the root directory of a repository’s `gh-pages` branch. This is useful for things like sites developed with [Yeoman](http://yeoman.io), or if you have a Jekyll site contained in the `master` branch alongside the rest of your code. -
Coby Chapple revised this gist
Mar 4, 2014 . 2 changed files with 47 additions and 26 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,47 @@ # Deploying a specific folder to GitHub Pages Sometimes you want to have a subdirectory on the `master` branch be the root directory of a repository’s `gh-pages` branch. This is useful for things like sites developed with [Yeoman](http://yeoman.io), or if you have a Jekyll site contained in the `master` branch alongside the rest of your code. For the sake of this example, let’s pretend the subfolder containing your site is named `dist`. ### Step 1 Remove the `dist` directory from the project’s `.gitignore` file (it’s ignored by default by Yeoman). ### Step 2 Make sure git knows about your subtree (the subfolder with your site). ```sh git add dist && git commit -m "Initial dist subtree commit" ``` ### Step 3 Use subtree push to send it to the `gh-pages` branch on GitHub. ```sh git subtree push --prefix dist origin gh-pages ``` Boom. If your folder isn’t called `dist`, then you’ll need to change that in each of the commands above. --- If you do this on a regular basis, you could also [create a script](https://github.com/cobyism/dotfiles/blob/master/bin/git-gh-deploy) containing the following somewhere in your path: ```sh #!/bin/sh if [ -z "$1" ] then echo "Which folder do you want to deploy to GitHub Pages?" exit 1 fi git subtree push --prefix $1 origin gh-pages ``` Which lets you type commands like: ```sh git gh-deploy path/to/your/site ``` 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 charactersOriginal file line number Diff line number Diff line change @@ -1,26 +0,0 @@ -
Coby Chapple revised this gist
Feb 7, 2013 . 1 changed file with 2 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ Sometimes you want to have a subdirectory on the `master` branch be the root dir ### Step 1 Remove the `dist` directory from the project’s `.gitignore` file (it’s ignored by default by yeoman). ### Step 2 @@ -22,6 +22,5 @@ Deploy dat subtree. ```sh git subtree push --prefix dist origin gh-pages ``` Boom. If your folder isn’t called `dist`, then you’ll need to change that in each of the commands above. -
Coby Chapple revised this gist
Feb 7, 2013 . 1 changed file with 21 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -2,8 +2,26 @@ Sometimes you want to have a subdirectory on the `master` branch be the root directory of a repository’s `gh-pages` branch. This is useful for things like sites developed with [Yeoman](http://yeoman.io). ### Step 1 Remove the `dist` directory from the project’s `.gitignore` file. ### Step 2 Set up the subtree. ```sh git add dist && git commit -m "Initial dist subtree commit" git subtree push --prefix dist origin gh-pages ``` ### Step 3 Deploy dat subtree. ```sh git subtree push --prefix dist origin gh-pages ``` --- Boom. -
Coby Chapple revised this gist
Feb 7, 2013 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,9 @@ # Deploying a dist folder to GitHub Pages Sometimes you want to have a subdirectory on the `master` branch be the root directory of a repository’s `gh-pages` branch. This is useful for things like sites developed with [Yeoman](http://yeoman.io). 1. Remove the `dist` directory from the project’s `.gitignore` file. 2. Run the script below called `setup.sh` to set up the subtree. 3. Run the script below called `deploy.sh` to deploy the subtree to GitHub Pages. Boom. -
Coby Chapple created this gist
Feb 7, 2013 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ # Deploying a dist folder to GitHub Pages Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s `gh-pages` branch. This is useful for things like sites developed with [Yeoman](http://yeoman.io). 1. Remove the `dist` directory from the project’s `.gitignore` file. 2. Run the script below called `setup.sh` to set up the subtree. 3. Run the script below called `deploy.sh` to deploy the subtree to GitHub Pages. :boom: