Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8953285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:03:52+00:00 2026-06-15T14:03:52+00:00

I am working on a web app, hosting the source code on Github and

  • 0

I am working on a web app, hosting the source code on Github and running the app on Heroku. Everything works fine, but I have on issue I can’t wrap my head around. Before the deploying my code, I run some scripts to optimize the code (minifying, concatenating files etc.). The heroku app only uses the optimized version of the app.

Basically, I have two folders: dev and production. Dev contains the source code I write, production is produced by my build scripts (I use grunt and requirejs). Currently, both folders are in my Git repository and both are pushed to Github and Heroku. What I’d rather like is to only have dev on Github and only production on Heroku.
I read some articles how to setup different branches for Heroku, as described in this blog. Could I setup a production branch and only have the production folder in there while keeping the dev folder to my master branch? Or would I need separate repositories?

Has anyone tried something similar? I would assume that this is not something out of the ordinary.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T14:03:53+00:00Added an answer on June 15, 2026 at 2:03 pm

    You may want to simply consider using the heroku .slugignore file (ref https://devcenter.heroku.com/articles/slug-compiler).

    This file would allow you remove the dev folder from the package that heroku deploys to each server instance, while allowing you to keep all your code in the same repository.

    The root of the problem is thinking about the deployment strategy as one where you upload final bits to your server, where the bits are an artefact of building your repository. In such cases, builds are usually stored and archived separately from the source.

    Heroku’s model is slightly different from this in that it assumes your repository is the artefact to deploy. The difference is slight, but in your case, it just means that you need to commit to your repository the bits you want heroku to serve.

    Another way of thinking about it is that you could do without your production folder, and as part of starting your server, the script would be run to generate the production folder files. This would allow you to remove the production folder, and keep your repository clean at the cost of running this process on every start of your server. This may prove to be prohibitively expensive and undesirable (there are limits to how long Heroku will wait for a server to startup before it gives up on it), but hopefully helps in providing some clarity around the Heroku and git relationship.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Gurus of SO I have a working web app which works well enough with
Im working on an web app using c#. I have in my code the
I'm working on a web app, and i already have a hosting. I made
I have been working on a small web app using the Stripes framework. Now
I have uploaded a working Cakephp web application to Mosso Cloud Sites hosting. The
im working on a web app and my code is working good in chrome
Im working with django, building a web app. I have most stuff working. The
I have a working web app which can do search for User objects through
I am working on web app with jquery, jqueryui, ajaxify and many jquery extensions.
I am working on a web app and was testing it on my ipad

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.