GIT getting 2 branches from another machine onto mine

Multi tool use
Multi tool use












3














I'm new to git so I'm setting up a git workflow to get the hang of it and I'm not sure how to get a branch on another machine onto mine, I've got 2 branches on my desktop:



master
release-0.1


The remote has these 2 branches too:



master
release-0.1


Then there's my laptop which has an old copy of master that needs to be deleted, and 2 other branches not on either remote or my desktop:



master (deleting)
new-feature-a
new-feature-b


I'm new to git so I'm not really sure what I should do, I want to work on new-feature-a on my desktop now and only work on new-feature-b on the laptop. Should I push new-feature-a to origin/new-feature-a then pull it to the desktop? Then once the feature is complete push it to the release-0.1 branch then merge it into master?




  • Should I keep a copy of master locally?










share|improve this question






















  • "Should I keep a copy of master locally?" this is a really smart question
    – Dan Farrell
    Dec 28 '18 at 3:07
















3














I'm new to git so I'm setting up a git workflow to get the hang of it and I'm not sure how to get a branch on another machine onto mine, I've got 2 branches on my desktop:



master
release-0.1


The remote has these 2 branches too:



master
release-0.1


Then there's my laptop which has an old copy of master that needs to be deleted, and 2 other branches not on either remote or my desktop:



master (deleting)
new-feature-a
new-feature-b


I'm new to git so I'm not really sure what I should do, I want to work on new-feature-a on my desktop now and only work on new-feature-b on the laptop. Should I push new-feature-a to origin/new-feature-a then pull it to the desktop? Then once the feature is complete push it to the release-0.1 branch then merge it into master?




  • Should I keep a copy of master locally?










share|improve this question






















  • "Should I keep a copy of master locally?" this is a really smart question
    – Dan Farrell
    Dec 28 '18 at 3:07














3












3








3


2





I'm new to git so I'm setting up a git workflow to get the hang of it and I'm not sure how to get a branch on another machine onto mine, I've got 2 branches on my desktop:



master
release-0.1


The remote has these 2 branches too:



master
release-0.1


Then there's my laptop which has an old copy of master that needs to be deleted, and 2 other branches not on either remote or my desktop:



master (deleting)
new-feature-a
new-feature-b


I'm new to git so I'm not really sure what I should do, I want to work on new-feature-a on my desktop now and only work on new-feature-b on the laptop. Should I push new-feature-a to origin/new-feature-a then pull it to the desktop? Then once the feature is complete push it to the release-0.1 branch then merge it into master?




  • Should I keep a copy of master locally?










share|improve this question













I'm new to git so I'm setting up a git workflow to get the hang of it and I'm not sure how to get a branch on another machine onto mine, I've got 2 branches on my desktop:



master
release-0.1


The remote has these 2 branches too:



master
release-0.1


Then there's my laptop which has an old copy of master that needs to be deleted, and 2 other branches not on either remote or my desktop:



master (deleting)
new-feature-a
new-feature-b


I'm new to git so I'm not really sure what I should do, I want to work on new-feature-a on my desktop now and only work on new-feature-b on the laptop. Should I push new-feature-a to origin/new-feature-a then pull it to the desktop? Then once the feature is complete push it to the release-0.1 branch then merge it into master?




  • Should I keep a copy of master locally?







git






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Dec 28 '18 at 3:03









coder

346




346












  • "Should I keep a copy of master locally?" this is a really smart question
    – Dan Farrell
    Dec 28 '18 at 3:07


















  • "Should I keep a copy of master locally?" this is a really smart question
    – Dan Farrell
    Dec 28 '18 at 3:07
















"Should I keep a copy of master locally?" this is a really smart question
– Dan Farrell
Dec 28 '18 at 3:07




"Should I keep a copy of master locally?" this is a really smart question
– Dan Farrell
Dec 28 '18 at 3:07












1 Answer
1






active

oldest

votes


















0














Here's what I would do



On the laptop




  • Commit all changes to new-feature-a

  • Push to remote


On Desktop




  • Pull new-feature-a

  • make changes and commit

  • Check out release-0.1

  • Merge with new-feature-a

  • Push release-0.1


  • Pull master


  • Merge with release-0.1

  • PUsh master


Yes, you will need the local copy of master if you wan to merge it with the new features.






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%2f53953216%2fgit-getting-2-branches-from-another-machine-onto-mine%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














    Here's what I would do



    On the laptop




    • Commit all changes to new-feature-a

    • Push to remote


    On Desktop




    • Pull new-feature-a

    • make changes and commit

    • Check out release-0.1

    • Merge with new-feature-a

    • Push release-0.1


    • Pull master


    • Merge with release-0.1

    • PUsh master


    Yes, you will need the local copy of master if you wan to merge it with the new features.






    share|improve this answer


























      0














      Here's what I would do



      On the laptop




      • Commit all changes to new-feature-a

      • Push to remote


      On Desktop




      • Pull new-feature-a

      • make changes and commit

      • Check out release-0.1

      • Merge with new-feature-a

      • Push release-0.1


      • Pull master


      • Merge with release-0.1

      • PUsh master


      Yes, you will need the local copy of master if you wan to merge it with the new features.






      share|improve this answer
























        0












        0








        0






        Here's what I would do



        On the laptop




        • Commit all changes to new-feature-a

        • Push to remote


        On Desktop




        • Pull new-feature-a

        • make changes and commit

        • Check out release-0.1

        • Merge with new-feature-a

        • Push release-0.1


        • Pull master


        • Merge with release-0.1

        • PUsh master


        Yes, you will need the local copy of master if you wan to merge it with the new features.






        share|improve this answer












        Here's what I would do



        On the laptop




        • Commit all changes to new-feature-a

        • Push to remote


        On Desktop




        • Pull new-feature-a

        • make changes and commit

        • Check out release-0.1

        • Merge with new-feature-a

        • Push release-0.1


        • Pull master


        • Merge with release-0.1

        • PUsh master


        Yes, you will need the local copy of master if you wan to merge it with the new features.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Dec 28 '18 at 3:28









        Zhao Hainan

        38226




        38226






























            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.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • 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%2f53953216%2fgit-getting-2-branches-from-another-machine-onto-mine%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







            48yfl3,sIP,FV5iDGtB3fFayqpo7cnkQADxrWqtfo3tzK,Lr2 YTCe,7b9rHIKxc,vvuKRYK
            5Iqga5E3 YpF8S8 NHJNOyfrno76baIYH0C5dvjK,qIss1sKno,3uABrKo3f,oYjEOQOuZqidEWlo1UcfGcEiV

            Popular posts from this blog

            Monofisismo

            compose and upload a new article using a custom form

            “attempting to read past stream EOM” using Sybase.AdoNet4.AseClient