Friday, April 11, 2014

Deploying a Yeoman-generated app dist folder using Git Subtree

Yeoman generated apps have a dist folder which contain the necessary files to run your web application.  When deploying to a server from Git, you do not need to pull an entire branch to it.  You just need to deploy the dist folder using the Git subtree command.  Here's how:

1.  Remove the dist folder from .gitignore.

2.  Add the dist directory to your repository.

git add dist && commit -m "Initial dist commit"


3.  Deploy the subtree to a different branch.  Specify a relative path to your dist folder with the --prefix

git subtree push --prefix dist origin distbranch


4. Develop normally, committing your entire repository to your default branch.

5. To deploy the dist folder, run the subtree push command from the root.

git subtree push --prefix dist origin distbranch


That's it!

2 comments:

  1. Hi!
    And how do i get it to my self hosted server?
    Thx

    ReplyDelete
  2. Hi!
    And how do i get it to my self hosted server?
    Thx

    ReplyDelete