Deploy to Heroku from local, and then later switch to Heroku from Github












0















I'm about to start building a MEAN stack web app, by first creating the Restful API and then later adding the front-end to it.



Since I plan to deploy this to Heroku, I'd like to integrate with Heroku from the start, using one of the many Heroku tutorials for this. This would all be done from my local computer. (This will be my first time using Heroku).



However, once the app is deployed and production-ready, I want to set up the automated Github integration (continuous deployment), like I've seen in many posts.



I've seen people talk about overwriting an existing Heroku app from Github, but my question is from the opposite angle:




  1. When I switch from using Local Git to Heroku and instead do Github to Heroku, will I have to "redeploy" the whole app from scratch?
    In other words, will my Github push to Heroku overwrite all of the existing code, or will all the database, setup, etc still be configured?


  2. What is the process to switch from Local Git -> Heroku and instead do Github -> Heroku for the same application?











share|improve this question



























    0















    I'm about to start building a MEAN stack web app, by first creating the Restful API and then later adding the front-end to it.



    Since I plan to deploy this to Heroku, I'd like to integrate with Heroku from the start, using one of the many Heroku tutorials for this. This would all be done from my local computer. (This will be my first time using Heroku).



    However, once the app is deployed and production-ready, I want to set up the automated Github integration (continuous deployment), like I've seen in many posts.



    I've seen people talk about overwriting an existing Heroku app from Github, but my question is from the opposite angle:




    1. When I switch from using Local Git to Heroku and instead do Github to Heroku, will I have to "redeploy" the whole app from scratch?
      In other words, will my Github push to Heroku overwrite all of the existing code, or will all the database, setup, etc still be configured?


    2. What is the process to switch from Local Git -> Heroku and instead do Github -> Heroku for the same application?











    share|improve this question

























      0












      0








      0








      I'm about to start building a MEAN stack web app, by first creating the Restful API and then later adding the front-end to it.



      Since I plan to deploy this to Heroku, I'd like to integrate with Heroku from the start, using one of the many Heroku tutorials for this. This would all be done from my local computer. (This will be my first time using Heroku).



      However, once the app is deployed and production-ready, I want to set up the automated Github integration (continuous deployment), like I've seen in many posts.



      I've seen people talk about overwriting an existing Heroku app from Github, but my question is from the opposite angle:




      1. When I switch from using Local Git to Heroku and instead do Github to Heroku, will I have to "redeploy" the whole app from scratch?
        In other words, will my Github push to Heroku overwrite all of the existing code, or will all the database, setup, etc still be configured?


      2. What is the process to switch from Local Git -> Heroku and instead do Github -> Heroku for the same application?











      share|improve this question














      I'm about to start building a MEAN stack web app, by first creating the Restful API and then later adding the front-end to it.



      Since I plan to deploy this to Heroku, I'd like to integrate with Heroku from the start, using one of the many Heroku tutorials for this. This would all be done from my local computer. (This will be my first time using Heroku).



      However, once the app is deployed and production-ready, I want to set up the automated Github integration (continuous deployment), like I've seen in many posts.



      I've seen people talk about overwriting an existing Heroku app from Github, but my question is from the opposite angle:




      1. When I switch from using Local Git to Heroku and instead do Github to Heroku, will I have to "redeploy" the whole app from scratch?
        In other words, will my Github push to Heroku overwrite all of the existing code, or will all the database, setup, etc still be configured?


      2. What is the process to switch from Local Git -> Heroku and instead do Github -> Heroku for the same application?








      node.js git github heroku






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 21 '18 at 6:24









      giraffe36giraffe36

      31




      31
























          1 Answer
          1






          active

          oldest

          votes


















          0















          When I switch from using Local Git to Heroku and instead do Github to Heroku, will I have to "redeploy" the whole app from scratch? In other words, will my Github push to Heroku overwrite all of the existing code, or will all the database, setup, etc still be configured?




          I think we need to take a closer look at how deployment works on Heroku.



          Enabling the GitHub integration will cause your application to be redeployed whenever you manually deploy from a GitHub branch, or automatically when the branch is updated, depending on how you set it up.



          As far as deployment is concerned, this is no different from pushing a new version from your local machine. In both cases, Heroku will compile your application into a new slug, and assuming the build succeeds that slug will be made to run on your dyno formation. Essentially, "all of the existing code" gets replaced on every deploy, regardless of how it's done.



          Any client-server¹ databases you have set up shouldn't be affected by the deploy. They exist outside of your application slug.



          Heroku encourages users to get configuration from the environment. If you follow that guideline, deploying a new version shouldn't affect your configuration either. Environment variables set up on one version of an app remain in place after a new version is deployed, regardless of whether it's done via git push or GitHub integration.



          In short, very little changes about how your application gets deployed when you enable GitHub integration². You can even deploy from your local machine via git push without disabling the GitHub integration if you want.



          If you get comfortable with Heroku's architecture and deploy process locally you should have very little trouble when you enable GitHub integration.




          What is the process to switch from Local Git -> Heroku and instead do Github -> Heroku for the same application?




          Just enable it and follow the instructions. You'll be asked to authorize Heroku to interact with GitHub for you. "Switching" doesn't have any impact on this process (and in fact isn't really accurate: you're enabling a second way of deploying, not switching).





          ¹File-based databases like SQLite won't work on Heroku due to its ephemeral filesystem.



          ²Refs aren't created in Heroku's Git server for code deployed directly from GitHub. I.e., if you deploy from GitHub and then git fetch from Heroku you won't see anything new from GitHub. Of course, you can still use Git to push, fetch, and pull directly to and from GitHub.






          share|improve this answer

























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53406333%2fdeploy-to-heroku-from-local-and-then-later-switch-to-heroku-from-github%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0















            When I switch from using Local Git to Heroku and instead do Github to Heroku, will I have to "redeploy" the whole app from scratch? In other words, will my Github push to Heroku overwrite all of the existing code, or will all the database, setup, etc still be configured?




            I think we need to take a closer look at how deployment works on Heroku.



            Enabling the GitHub integration will cause your application to be redeployed whenever you manually deploy from a GitHub branch, or automatically when the branch is updated, depending on how you set it up.



            As far as deployment is concerned, this is no different from pushing a new version from your local machine. In both cases, Heroku will compile your application into a new slug, and assuming the build succeeds that slug will be made to run on your dyno formation. Essentially, "all of the existing code" gets replaced on every deploy, regardless of how it's done.



            Any client-server¹ databases you have set up shouldn't be affected by the deploy. They exist outside of your application slug.



            Heroku encourages users to get configuration from the environment. If you follow that guideline, deploying a new version shouldn't affect your configuration either. Environment variables set up on one version of an app remain in place after a new version is deployed, regardless of whether it's done via git push or GitHub integration.



            In short, very little changes about how your application gets deployed when you enable GitHub integration². You can even deploy from your local machine via git push without disabling the GitHub integration if you want.



            If you get comfortable with Heroku's architecture and deploy process locally you should have very little trouble when you enable GitHub integration.




            What is the process to switch from Local Git -> Heroku and instead do Github -> Heroku for the same application?




            Just enable it and follow the instructions. You'll be asked to authorize Heroku to interact with GitHub for you. "Switching" doesn't have any impact on this process (and in fact isn't really accurate: you're enabling a second way of deploying, not switching).





            ¹File-based databases like SQLite won't work on Heroku due to its ephemeral filesystem.



            ²Refs aren't created in Heroku's Git server for code deployed directly from GitHub. I.e., if you deploy from GitHub and then git fetch from Heroku you won't see anything new from GitHub. Of course, you can still use Git to push, fetch, and pull directly to and from GitHub.






            share|improve this answer






























              0















              When I switch from using Local Git to Heroku and instead do Github to Heroku, will I have to "redeploy" the whole app from scratch? In other words, will my Github push to Heroku overwrite all of the existing code, or will all the database, setup, etc still be configured?




              I think we need to take a closer look at how deployment works on Heroku.



              Enabling the GitHub integration will cause your application to be redeployed whenever you manually deploy from a GitHub branch, or automatically when the branch is updated, depending on how you set it up.



              As far as deployment is concerned, this is no different from pushing a new version from your local machine. In both cases, Heroku will compile your application into a new slug, and assuming the build succeeds that slug will be made to run on your dyno formation. Essentially, "all of the existing code" gets replaced on every deploy, regardless of how it's done.



              Any client-server¹ databases you have set up shouldn't be affected by the deploy. They exist outside of your application slug.



              Heroku encourages users to get configuration from the environment. If you follow that guideline, deploying a new version shouldn't affect your configuration either. Environment variables set up on one version of an app remain in place after a new version is deployed, regardless of whether it's done via git push or GitHub integration.



              In short, very little changes about how your application gets deployed when you enable GitHub integration². You can even deploy from your local machine via git push without disabling the GitHub integration if you want.



              If you get comfortable with Heroku's architecture and deploy process locally you should have very little trouble when you enable GitHub integration.




              What is the process to switch from Local Git -> Heroku and instead do Github -> Heroku for the same application?




              Just enable it and follow the instructions. You'll be asked to authorize Heroku to interact with GitHub for you. "Switching" doesn't have any impact on this process (and in fact isn't really accurate: you're enabling a second way of deploying, not switching).





              ¹File-based databases like SQLite won't work on Heroku due to its ephemeral filesystem.



              ²Refs aren't created in Heroku's Git server for code deployed directly from GitHub. I.e., if you deploy from GitHub and then git fetch from Heroku you won't see anything new from GitHub. Of course, you can still use Git to push, fetch, and pull directly to and from GitHub.






              share|improve this answer




























                0












                0








                0








                When I switch from using Local Git to Heroku and instead do Github to Heroku, will I have to "redeploy" the whole app from scratch? In other words, will my Github push to Heroku overwrite all of the existing code, or will all the database, setup, etc still be configured?




                I think we need to take a closer look at how deployment works on Heroku.



                Enabling the GitHub integration will cause your application to be redeployed whenever you manually deploy from a GitHub branch, or automatically when the branch is updated, depending on how you set it up.



                As far as deployment is concerned, this is no different from pushing a new version from your local machine. In both cases, Heroku will compile your application into a new slug, and assuming the build succeeds that slug will be made to run on your dyno formation. Essentially, "all of the existing code" gets replaced on every deploy, regardless of how it's done.



                Any client-server¹ databases you have set up shouldn't be affected by the deploy. They exist outside of your application slug.



                Heroku encourages users to get configuration from the environment. If you follow that guideline, deploying a new version shouldn't affect your configuration either. Environment variables set up on one version of an app remain in place after a new version is deployed, regardless of whether it's done via git push or GitHub integration.



                In short, very little changes about how your application gets deployed when you enable GitHub integration². You can even deploy from your local machine via git push without disabling the GitHub integration if you want.



                If you get comfortable with Heroku's architecture and deploy process locally you should have very little trouble when you enable GitHub integration.




                What is the process to switch from Local Git -> Heroku and instead do Github -> Heroku for the same application?




                Just enable it and follow the instructions. You'll be asked to authorize Heroku to interact with GitHub for you. "Switching" doesn't have any impact on this process (and in fact isn't really accurate: you're enabling a second way of deploying, not switching).





                ¹File-based databases like SQLite won't work on Heroku due to its ephemeral filesystem.



                ²Refs aren't created in Heroku's Git server for code deployed directly from GitHub. I.e., if you deploy from GitHub and then git fetch from Heroku you won't see anything new from GitHub. Of course, you can still use Git to push, fetch, and pull directly to and from GitHub.






                share|improve this answer
















                When I switch from using Local Git to Heroku and instead do Github to Heroku, will I have to "redeploy" the whole app from scratch? In other words, will my Github push to Heroku overwrite all of the existing code, or will all the database, setup, etc still be configured?




                I think we need to take a closer look at how deployment works on Heroku.



                Enabling the GitHub integration will cause your application to be redeployed whenever you manually deploy from a GitHub branch, or automatically when the branch is updated, depending on how you set it up.



                As far as deployment is concerned, this is no different from pushing a new version from your local machine. In both cases, Heroku will compile your application into a new slug, and assuming the build succeeds that slug will be made to run on your dyno formation. Essentially, "all of the existing code" gets replaced on every deploy, regardless of how it's done.



                Any client-server¹ databases you have set up shouldn't be affected by the deploy. They exist outside of your application slug.



                Heroku encourages users to get configuration from the environment. If you follow that guideline, deploying a new version shouldn't affect your configuration either. Environment variables set up on one version of an app remain in place after a new version is deployed, regardless of whether it's done via git push or GitHub integration.



                In short, very little changes about how your application gets deployed when you enable GitHub integration². You can even deploy from your local machine via git push without disabling the GitHub integration if you want.



                If you get comfortable with Heroku's architecture and deploy process locally you should have very little trouble when you enable GitHub integration.




                What is the process to switch from Local Git -> Heroku and instead do Github -> Heroku for the same application?




                Just enable it and follow the instructions. You'll be asked to authorize Heroku to interact with GitHub for you. "Switching" doesn't have any impact on this process (and in fact isn't really accurate: you're enabling a second way of deploying, not switching).





                ¹File-based databases like SQLite won't work on Heroku due to its ephemeral filesystem.



                ²Refs aren't created in Heroku's Git server for code deployed directly from GitHub. I.e., if you deploy from GitHub and then git fetch from Heroku you won't see anything new from GitHub. Of course, you can still use Git to push, fetch, and pull directly to and from GitHub.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Nov 21 '18 at 16:28

























                answered Nov 21 '18 at 13:26









                ChrisChris

                54.9k17119116




                54.9k17119116






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53406333%2fdeploy-to-heroku-from-local-and-then-later-switch-to-heroku-from-github%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    MongoDB - Not Authorized To Execute Command

                    How to fix TextFormField cause rebuild widget in Flutter

                    Npm cannot find a required file even through it is in the searched directory