Git Merge ignores files that were reverted from develop but added on feature branch












2















I have 2 branches develop & feature. I did a commit A on develop branch, then I reverted it.



Then I did another commit B on feature branch, which modifies the same file modified then reverted on develop branch.



Now, when I try to create a Pull Request to merge feature branch into develop branch, the files modified in commit B are ignored and do not appear neither as conflict, nor as edited and merged files in my pull request.



Where is the problem ?










share|improve this question























  • Not enough information to diagnose. This can happen if the change you made on feature happens to match one or more changes in develop. The two sides agree, so there is no net change.

    – Raymond Chen
    Sep 17 '18 at 13:59











  • not really the case, The file was in state 1, then changed to state 2, got reverted to state 1 again (all these steps were done on develop). On feature branch, the file changed to state 2. During Merge of feature into develop, the file is shown as it is in state 1.

    – NTinkicht
    Sep 17 '18 at 14:04













  • What was the (type of) change in commit B? Try doing a diff between B and A2 (reverted) to see if there is actually anything there.

    – Philip Oakley
    Sep 17 '18 at 14:09











  • juste code modification within file, no move, no delete, no add

    – NTinkicht
    Sep 17 '18 at 14:31











  • I cannot reproduce. git init; echo hi>foo; git add foo; git commit -m hi; git checkout -b feature; echo change>foo; git commit -am change; git checkout master; echo change>foo; git commit -am change2; echo hi>foo; git commit -am back; git merge feature - the result of the merge is that the file is changed to change.

    – Raymond Chen
    Sep 18 '18 at 0:48
















2















I have 2 branches develop & feature. I did a commit A on develop branch, then I reverted it.



Then I did another commit B on feature branch, which modifies the same file modified then reverted on develop branch.



Now, when I try to create a Pull Request to merge feature branch into develop branch, the files modified in commit B are ignored and do not appear neither as conflict, nor as edited and merged files in my pull request.



Where is the problem ?










share|improve this question























  • Not enough information to diagnose. This can happen if the change you made on feature happens to match one or more changes in develop. The two sides agree, so there is no net change.

    – Raymond Chen
    Sep 17 '18 at 13:59











  • not really the case, The file was in state 1, then changed to state 2, got reverted to state 1 again (all these steps were done on develop). On feature branch, the file changed to state 2. During Merge of feature into develop, the file is shown as it is in state 1.

    – NTinkicht
    Sep 17 '18 at 14:04













  • What was the (type of) change in commit B? Try doing a diff between B and A2 (reverted) to see if there is actually anything there.

    – Philip Oakley
    Sep 17 '18 at 14:09











  • juste code modification within file, no move, no delete, no add

    – NTinkicht
    Sep 17 '18 at 14:31











  • I cannot reproduce. git init; echo hi>foo; git add foo; git commit -m hi; git checkout -b feature; echo change>foo; git commit -am change; git checkout master; echo change>foo; git commit -am change2; echo hi>foo; git commit -am back; git merge feature - the result of the merge is that the file is changed to change.

    – Raymond Chen
    Sep 18 '18 at 0:48














2












2








2


2






I have 2 branches develop & feature. I did a commit A on develop branch, then I reverted it.



Then I did another commit B on feature branch, which modifies the same file modified then reverted on develop branch.



Now, when I try to create a Pull Request to merge feature branch into develop branch, the files modified in commit B are ignored and do not appear neither as conflict, nor as edited and merged files in my pull request.



Where is the problem ?










share|improve this question














I have 2 branches develop & feature. I did a commit A on develop branch, then I reverted it.



Then I did another commit B on feature branch, which modifies the same file modified then reverted on develop branch.



Now, when I try to create a Pull Request to merge feature branch into develop branch, the files modified in commit B are ignored and do not appear neither as conflict, nor as edited and merged files in my pull request.



Where is the problem ?







git git-merge pull-request






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Sep 17 '18 at 12:40









NTinkichtNTinkicht

5902829




5902829













  • Not enough information to diagnose. This can happen if the change you made on feature happens to match one or more changes in develop. The two sides agree, so there is no net change.

    – Raymond Chen
    Sep 17 '18 at 13:59











  • not really the case, The file was in state 1, then changed to state 2, got reverted to state 1 again (all these steps were done on develop). On feature branch, the file changed to state 2. During Merge of feature into develop, the file is shown as it is in state 1.

    – NTinkicht
    Sep 17 '18 at 14:04













  • What was the (type of) change in commit B? Try doing a diff between B and A2 (reverted) to see if there is actually anything there.

    – Philip Oakley
    Sep 17 '18 at 14:09











  • juste code modification within file, no move, no delete, no add

    – NTinkicht
    Sep 17 '18 at 14:31











  • I cannot reproduce. git init; echo hi>foo; git add foo; git commit -m hi; git checkout -b feature; echo change>foo; git commit -am change; git checkout master; echo change>foo; git commit -am change2; echo hi>foo; git commit -am back; git merge feature - the result of the merge is that the file is changed to change.

    – Raymond Chen
    Sep 18 '18 at 0:48



















  • Not enough information to diagnose. This can happen if the change you made on feature happens to match one or more changes in develop. The two sides agree, so there is no net change.

    – Raymond Chen
    Sep 17 '18 at 13:59











  • not really the case, The file was in state 1, then changed to state 2, got reverted to state 1 again (all these steps were done on develop). On feature branch, the file changed to state 2. During Merge of feature into develop, the file is shown as it is in state 1.

    – NTinkicht
    Sep 17 '18 at 14:04













  • What was the (type of) change in commit B? Try doing a diff between B and A2 (reverted) to see if there is actually anything there.

    – Philip Oakley
    Sep 17 '18 at 14:09











  • juste code modification within file, no move, no delete, no add

    – NTinkicht
    Sep 17 '18 at 14:31











  • I cannot reproduce. git init; echo hi>foo; git add foo; git commit -m hi; git checkout -b feature; echo change>foo; git commit -am change; git checkout master; echo change>foo; git commit -am change2; echo hi>foo; git commit -am back; git merge feature - the result of the merge is that the file is changed to change.

    – Raymond Chen
    Sep 18 '18 at 0:48

















Not enough information to diagnose. This can happen if the change you made on feature happens to match one or more changes in develop. The two sides agree, so there is no net change.

– Raymond Chen
Sep 17 '18 at 13:59





Not enough information to diagnose. This can happen if the change you made on feature happens to match one or more changes in develop. The two sides agree, so there is no net change.

– Raymond Chen
Sep 17 '18 at 13:59













not really the case, The file was in state 1, then changed to state 2, got reverted to state 1 again (all these steps were done on develop). On feature branch, the file changed to state 2. During Merge of feature into develop, the file is shown as it is in state 1.

– NTinkicht
Sep 17 '18 at 14:04







not really the case, The file was in state 1, then changed to state 2, got reverted to state 1 again (all these steps were done on develop). On feature branch, the file changed to state 2. During Merge of feature into develop, the file is shown as it is in state 1.

– NTinkicht
Sep 17 '18 at 14:04















What was the (type of) change in commit B? Try doing a diff between B and A2 (reverted) to see if there is actually anything there.

– Philip Oakley
Sep 17 '18 at 14:09





What was the (type of) change in commit B? Try doing a diff between B and A2 (reverted) to see if there is actually anything there.

– Philip Oakley
Sep 17 '18 at 14:09













juste code modification within file, no move, no delete, no add

– NTinkicht
Sep 17 '18 at 14:31





juste code modification within file, no move, no delete, no add

– NTinkicht
Sep 17 '18 at 14:31













I cannot reproduce. git init; echo hi>foo; git add foo; git commit -m hi; git checkout -b feature; echo change>foo; git commit -am change; git checkout master; echo change>foo; git commit -am change2; echo hi>foo; git commit -am back; git merge feature - the result of the merge is that the file is changed to change.

– Raymond Chen
Sep 18 '18 at 0:48





I cannot reproduce. git init; echo hi>foo; git add foo; git commit -m hi; git checkout -b feature; echo change>foo; git commit -am change; git checkout master; echo change>foo; git commit -am change2; echo hi>foo; git commit -am back; git merge feature - the result of the merge is that the file is changed to change.

– Raymond Chen
Sep 18 '18 at 0:48












1 Answer
1






active

oldest

votes


















2














As a workaround, you can replay your local feature branch on top of the updated develop branch:



git checkout feature
git fetch
git rebase origin/develop


That way, you are only publishing new commits on top of the latest state of the develop branch.



git push --force
# that will update your existing PR, or make a new one





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%2f52367995%2fgit-merge-ignores-files-that-were-reverted-from-develop-but-added-on-feature-bra%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









    2














    As a workaround, you can replay your local feature branch on top of the updated develop branch:



    git checkout feature
    git fetch
    git rebase origin/develop


    That way, you are only publishing new commits on top of the latest state of the develop branch.



    git push --force
    # that will update your existing PR, or make a new one





    share|improve this answer




























      2














      As a workaround, you can replay your local feature branch on top of the updated develop branch:



      git checkout feature
      git fetch
      git rebase origin/develop


      That way, you are only publishing new commits on top of the latest state of the develop branch.



      git push --force
      # that will update your existing PR, or make a new one





      share|improve this answer


























        2












        2








        2







        As a workaround, you can replay your local feature branch on top of the updated develop branch:



        git checkout feature
        git fetch
        git rebase origin/develop


        That way, you are only publishing new commits on top of the latest state of the develop branch.



        git push --force
        # that will update your existing PR, or make a new one





        share|improve this answer













        As a workaround, you can replay your local feature branch on top of the updated develop branch:



        git checkout feature
        git fetch
        git rebase origin/develop


        That way, you are only publishing new commits on top of the latest state of the develop branch.



        git push --force
        # that will update your existing PR, or make a new one






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Dec 31 '18 at 8:27









        VonCVonC

        839k29426543197




        839k29426543197






























            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%2f52367995%2fgit-merge-ignores-files-that-were-reverted-from-develop-but-added-on-feature-bra%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

            Monofisismo

            Angular Downloading a file using contenturl with Basic Authentication

            Olmecas