Merge Branch || git diff not including .gitignore filesHow to connect separate Eclipse Patch Org project to Git(hub) remote branch of another Eclipse project?Eclipse: Not pointing to the correct Git DirectoryCloned Git Repostiory and MavensMate [Does not work]Using Eclipse Kepler and installed EGit plugin, but not getting git option in Teamhow do you avoid “meta.xml” files from being deleted during a mergeForce.com migration tool is not working after git auto packing repositorySalesforce CLI tools do not work together with Git Bash on Windowsforce:mdapi:convert duplicate filesSFDX - force:source:convert command not including label, sharingmodel, name in CustomObjectCan SFDX report files that were specified in the package.xml that do not exist in the org similar to ANT

Sum Square Difference, which way is more Pythonic?

What was the intention with the Commodore 128?

Why aren't rockets built with truss structures inside their fuel & oxidizer tanks to increase structural strength?

What should I do with the stock I own if I anticipate there will be a recession?

Why does Japan use the same type of AC power outlet as the US?

What should we do with manuals from the 80s?

If a person claims to know anything could it be disproven by saying 'prove that we are not in a simulation'?

A man in the desert is bitten by a skeletal animal, its skull gets stuck on his arm

How to measure if Scrum Master is making a difference and when to give up

Escape Velocity - Won't the orbital path just become larger with higher initial velocity?

How do figure out how powerful I am, when my abilities far exceed my knowledge?

What should I do if actually I found a serious flaw in someone's PhD thesis and an article derived from that PhD thesis?

Solving pricing problem heuristically in column generation algorithm for VRP

Weird resistor with dots around it

What is the farthest a camera can see?

Is there a word for returning to unpreparedness?

Cusp forms have an orthonormal basis of eigenfunctions for all Hecke operators

Can anybody tell me who this Pokemon is?

What is the opposite of "hunger level"?

How would armour (and combat) change if the fighter didn't need to actually wear it?

Heyawake: An Introductory Puzzle

What is a "soap"?

How can I shoot a bow using Strength instead of Dexterity?

Are there really no countries that protect Freedom of Speech as the United States does?



Merge Branch || git diff not including .gitignore files


How to connect separate Eclipse Patch Org project to Git(hub) remote branch of another Eclipse project?Eclipse: Not pointing to the correct Git DirectoryCloned Git Repostiory and MavensMate [Does not work]Using Eclipse Kepler and installed EGit plugin, but not getting git option in Teamhow do you avoid “meta.xml” files from being deleted during a mergeForce.com migration tool is not working after git auto packing repositorySalesforce CLI tools do not work together with Git Bash on Windowsforce:mdapi:convert duplicate filesSFDX - force:source:convert command not including label, sharingmodel, name in CustomObjectCan SFDX report files that were specified in the package.xml that do not exist in the org similar to ANT






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








3















I have 2 branches in SFDX enabled project. mybranch and develop. I want to merge selected changes from develop and then merge those in mybranch. As a starting point I am trying to use git diff to see what all is extra in develop, however, it is mentioning files like .forceignore, .gitignore and all. And I want to compare only force-app folder. Is there any way I could make git diff & git merge to ignore a set of files & folder as .gitignore is not working. FYI, I have already gone through following and it doesn't help me - https://stackoverflow.com/questions/17820056/git-diff-doesnt-ignore-specified-files-in-gitignore



Appreciate help with this.










share|improve this question






























    3















    I have 2 branches in SFDX enabled project. mybranch and develop. I want to merge selected changes from develop and then merge those in mybranch. As a starting point I am trying to use git diff to see what all is extra in develop, however, it is mentioning files like .forceignore, .gitignore and all. And I want to compare only force-app folder. Is there any way I could make git diff & git merge to ignore a set of files & folder as .gitignore is not working. FYI, I have already gone through following and it doesn't help me - https://stackoverflow.com/questions/17820056/git-diff-doesnt-ignore-specified-files-in-gitignore



    Appreciate help with this.










    share|improve this question


























      3












      3








      3








      I have 2 branches in SFDX enabled project. mybranch and develop. I want to merge selected changes from develop and then merge those in mybranch. As a starting point I am trying to use git diff to see what all is extra in develop, however, it is mentioning files like .forceignore, .gitignore and all. And I want to compare only force-app folder. Is there any way I could make git diff & git merge to ignore a set of files & folder as .gitignore is not working. FYI, I have already gone through following and it doesn't help me - https://stackoverflow.com/questions/17820056/git-diff-doesnt-ignore-specified-files-in-gitignore



      Appreciate help with this.










      share|improve this question














      I have 2 branches in SFDX enabled project. mybranch and develop. I want to merge selected changes from develop and then merge those in mybranch. As a starting point I am trying to use git diff to see what all is extra in develop, however, it is mentioning files like .forceignore, .gitignore and all. And I want to compare only force-app folder. Is there any way I could make git diff & git merge to ignore a set of files & folder as .gitignore is not working. FYI, I have already gone through following and it doesn't help me - https://stackoverflow.com/questions/17820056/git-diff-doesnt-ignore-specified-files-in-gitignore



      Appreciate help with this.







      salesforcedx salesforcedx-cli git github






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Aug 4 at 3:59









      Varun SFDCVarun SFDC

      585 bronze badges




      585 bronze badges























          2 Answers
          2






          active

          oldest

          votes


















          4














          What I feel like is you are doing something wrong from the very beginning. You should include only the files you are interested in in your git repository and branch that to make the feature branch.



          I am not quite sure whether my previous assumption is correct. But to your situation, I would recommend using git cherry-pick in this case. Follow this document here: https://git-scm.com/docs/git-cherry-pick You should be able to select a selection of changes to merge into develop.






          share|improve this answer

























          • Hello Lance, Thanks for your response... I understand your view point however, it's just the constraint of scratch Org and SFDX Project because of which I am in this dilemma. I will definitely go through cherry-pick but something tells me there should be a reason .gitignore isn't working and that is bothering me

            – Varun SFDC
            Aug 4 at 4:29











          • @VarunSFDC if I understand correctly, those are the files you want to include in your repository but don't want to compare and merge. Is that correct?

            – Lance Shi
            Aug 4 at 4:31











          • Yes Lance.. exactly... dont want to merge and dont want to have as an o/p to git diff... struggling a bit though to achieve this as of now.

            – Varun SFDC
            Aug 4 at 4:34











          • As far as I can tell, git diff is only for you to ignore files which you don't want to have them in your repository. To exclude the ones you don't want to merge, you need to use cherry-pick. I can be wrong though. But this is what I remember

            – Lance Shi
            Aug 4 at 4:43











          • Thanks for the feedback Lance... I will go through cherry-pick. But for now I will keep the conversation open just in case someone can add on more.

            – Varun SFDC
            Aug 4 at 4:45



















          0














          Unfortunately, I could not understand much about cherry-pick for my scenario. However, below did helped me hence thought of sharing with you:



          git diff scratchorg..develop --name-only -- . ":(exclude).gitignore"



          and then



          git checkout develop Filename






          share|improve this answer



























            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "459"
            ;
            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: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            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%2fsalesforce.stackexchange.com%2fquestions%2f272253%2fmerge-branch-git-diff-not-including-gitignore-files%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            4














            What I feel like is you are doing something wrong from the very beginning. You should include only the files you are interested in in your git repository and branch that to make the feature branch.



            I am not quite sure whether my previous assumption is correct. But to your situation, I would recommend using git cherry-pick in this case. Follow this document here: https://git-scm.com/docs/git-cherry-pick You should be able to select a selection of changes to merge into develop.






            share|improve this answer

























            • Hello Lance, Thanks for your response... I understand your view point however, it's just the constraint of scratch Org and SFDX Project because of which I am in this dilemma. I will definitely go through cherry-pick but something tells me there should be a reason .gitignore isn't working and that is bothering me

              – Varun SFDC
              Aug 4 at 4:29











            • @VarunSFDC if I understand correctly, those are the files you want to include in your repository but don't want to compare and merge. Is that correct?

              – Lance Shi
              Aug 4 at 4:31











            • Yes Lance.. exactly... dont want to merge and dont want to have as an o/p to git diff... struggling a bit though to achieve this as of now.

              – Varun SFDC
              Aug 4 at 4:34











            • As far as I can tell, git diff is only for you to ignore files which you don't want to have them in your repository. To exclude the ones you don't want to merge, you need to use cherry-pick. I can be wrong though. But this is what I remember

              – Lance Shi
              Aug 4 at 4:43











            • Thanks for the feedback Lance... I will go through cherry-pick. But for now I will keep the conversation open just in case someone can add on more.

              – Varun SFDC
              Aug 4 at 4:45
















            4














            What I feel like is you are doing something wrong from the very beginning. You should include only the files you are interested in in your git repository and branch that to make the feature branch.



            I am not quite sure whether my previous assumption is correct. But to your situation, I would recommend using git cherry-pick in this case. Follow this document here: https://git-scm.com/docs/git-cherry-pick You should be able to select a selection of changes to merge into develop.






            share|improve this answer

























            • Hello Lance, Thanks for your response... I understand your view point however, it's just the constraint of scratch Org and SFDX Project because of which I am in this dilemma. I will definitely go through cherry-pick but something tells me there should be a reason .gitignore isn't working and that is bothering me

              – Varun SFDC
              Aug 4 at 4:29











            • @VarunSFDC if I understand correctly, those are the files you want to include in your repository but don't want to compare and merge. Is that correct?

              – Lance Shi
              Aug 4 at 4:31











            • Yes Lance.. exactly... dont want to merge and dont want to have as an o/p to git diff... struggling a bit though to achieve this as of now.

              – Varun SFDC
              Aug 4 at 4:34











            • As far as I can tell, git diff is only for you to ignore files which you don't want to have them in your repository. To exclude the ones you don't want to merge, you need to use cherry-pick. I can be wrong though. But this is what I remember

              – Lance Shi
              Aug 4 at 4:43











            • Thanks for the feedback Lance... I will go through cherry-pick. But for now I will keep the conversation open just in case someone can add on more.

              – Varun SFDC
              Aug 4 at 4:45














            4












            4








            4







            What I feel like is you are doing something wrong from the very beginning. You should include only the files you are interested in in your git repository and branch that to make the feature branch.



            I am not quite sure whether my previous assumption is correct. But to your situation, I would recommend using git cherry-pick in this case. Follow this document here: https://git-scm.com/docs/git-cherry-pick You should be able to select a selection of changes to merge into develop.






            share|improve this answer













            What I feel like is you are doing something wrong from the very beginning. You should include only the files you are interested in in your git repository and branch that to make the feature branch.



            I am not quite sure whether my previous assumption is correct. But to your situation, I would recommend using git cherry-pick in this case. Follow this document here: https://git-scm.com/docs/git-cherry-pick You should be able to select a selection of changes to merge into develop.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Aug 4 at 4:25









            Lance ShiLance Shi

            7,9773 gold badges32 silver badges85 bronze badges




            7,9773 gold badges32 silver badges85 bronze badges















            • Hello Lance, Thanks for your response... I understand your view point however, it's just the constraint of scratch Org and SFDX Project because of which I am in this dilemma. I will definitely go through cherry-pick but something tells me there should be a reason .gitignore isn't working and that is bothering me

              – Varun SFDC
              Aug 4 at 4:29











            • @VarunSFDC if I understand correctly, those are the files you want to include in your repository but don't want to compare and merge. Is that correct?

              – Lance Shi
              Aug 4 at 4:31











            • Yes Lance.. exactly... dont want to merge and dont want to have as an o/p to git diff... struggling a bit though to achieve this as of now.

              – Varun SFDC
              Aug 4 at 4:34











            • As far as I can tell, git diff is only for you to ignore files which you don't want to have them in your repository. To exclude the ones you don't want to merge, you need to use cherry-pick. I can be wrong though. But this is what I remember

              – Lance Shi
              Aug 4 at 4:43











            • Thanks for the feedback Lance... I will go through cherry-pick. But for now I will keep the conversation open just in case someone can add on more.

              – Varun SFDC
              Aug 4 at 4:45


















            • Hello Lance, Thanks for your response... I understand your view point however, it's just the constraint of scratch Org and SFDX Project because of which I am in this dilemma. I will definitely go through cherry-pick but something tells me there should be a reason .gitignore isn't working and that is bothering me

              – Varun SFDC
              Aug 4 at 4:29











            • @VarunSFDC if I understand correctly, those are the files you want to include in your repository but don't want to compare and merge. Is that correct?

              – Lance Shi
              Aug 4 at 4:31











            • Yes Lance.. exactly... dont want to merge and dont want to have as an o/p to git diff... struggling a bit though to achieve this as of now.

              – Varun SFDC
              Aug 4 at 4:34











            • As far as I can tell, git diff is only for you to ignore files which you don't want to have them in your repository. To exclude the ones you don't want to merge, you need to use cherry-pick. I can be wrong though. But this is what I remember

              – Lance Shi
              Aug 4 at 4:43











            • Thanks for the feedback Lance... I will go through cherry-pick. But for now I will keep the conversation open just in case someone can add on more.

              – Varun SFDC
              Aug 4 at 4:45

















            Hello Lance, Thanks for your response... I understand your view point however, it's just the constraint of scratch Org and SFDX Project because of which I am in this dilemma. I will definitely go through cherry-pick but something tells me there should be a reason .gitignore isn't working and that is bothering me

            – Varun SFDC
            Aug 4 at 4:29





            Hello Lance, Thanks for your response... I understand your view point however, it's just the constraint of scratch Org and SFDX Project because of which I am in this dilemma. I will definitely go through cherry-pick but something tells me there should be a reason .gitignore isn't working and that is bothering me

            – Varun SFDC
            Aug 4 at 4:29













            @VarunSFDC if I understand correctly, those are the files you want to include in your repository but don't want to compare and merge. Is that correct?

            – Lance Shi
            Aug 4 at 4:31





            @VarunSFDC if I understand correctly, those are the files you want to include in your repository but don't want to compare and merge. Is that correct?

            – Lance Shi
            Aug 4 at 4:31













            Yes Lance.. exactly... dont want to merge and dont want to have as an o/p to git diff... struggling a bit though to achieve this as of now.

            – Varun SFDC
            Aug 4 at 4:34





            Yes Lance.. exactly... dont want to merge and dont want to have as an o/p to git diff... struggling a bit though to achieve this as of now.

            – Varun SFDC
            Aug 4 at 4:34













            As far as I can tell, git diff is only for you to ignore files which you don't want to have them in your repository. To exclude the ones you don't want to merge, you need to use cherry-pick. I can be wrong though. But this is what I remember

            – Lance Shi
            Aug 4 at 4:43





            As far as I can tell, git diff is only for you to ignore files which you don't want to have them in your repository. To exclude the ones you don't want to merge, you need to use cherry-pick. I can be wrong though. But this is what I remember

            – Lance Shi
            Aug 4 at 4:43













            Thanks for the feedback Lance... I will go through cherry-pick. But for now I will keep the conversation open just in case someone can add on more.

            – Varun SFDC
            Aug 4 at 4:45






            Thanks for the feedback Lance... I will go through cherry-pick. But for now I will keep the conversation open just in case someone can add on more.

            – Varun SFDC
            Aug 4 at 4:45














            0














            Unfortunately, I could not understand much about cherry-pick for my scenario. However, below did helped me hence thought of sharing with you:



            git diff scratchorg..develop --name-only -- . ":(exclude).gitignore"



            and then



            git checkout develop Filename






            share|improve this answer





























              0














              Unfortunately, I could not understand much about cherry-pick for my scenario. However, below did helped me hence thought of sharing with you:



              git diff scratchorg..develop --name-only -- . ":(exclude).gitignore"



              and then



              git checkout develop Filename






              share|improve this answer



























                0












                0








                0







                Unfortunately, I could not understand much about cherry-pick for my scenario. However, below did helped me hence thought of sharing with you:



                git diff scratchorg..develop --name-only -- . ":(exclude).gitignore"



                and then



                git checkout develop Filename






                share|improve this answer













                Unfortunately, I could not understand much about cherry-pick for my scenario. However, below did helped me hence thought of sharing with you:



                git diff scratchorg..develop --name-only -- . ":(exclude).gitignore"



                and then



                git checkout develop Filename







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 2 days ago









                Varun SFDCVarun SFDC

                585 bronze badges




                585 bronze badges






























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Salesforce Stack Exchange!


                    • 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%2fsalesforce.stackexchange.com%2fquestions%2f272253%2fmerge-branch-git-diff-not-including-gitignore-files%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

                    Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

                    Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

                    Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?