Why am I getting extra commits in my pull request?












0














Here is my git workflow:




  1. I create a feature branch from production.

  2. Hopefully hours go by (not days) as I make changes to feature branch.

  3. When I'm done...

  4. If days have gone by, I stash my changes.

  5. I'll do a git rebase origin master to pull latest into feature branch.

  6. I'll, then, git stash apply to get my changes back.

  7. I do a commit and then push the changes

  8. Then I create a PR to staging


When I create a Pull Request to staging from my feature branch, for some reason the PR will include other commits that aren't mine.



Question 1: Does the workflow above look normal?

Question 2: Why am I getting extra commits in my PR to staging?










share|improve this question
























  • Are you rebasing from staging to production as well, or just merging?
    – Lasse Vågsæther Karlsen
    Nov 22 '18 at 6:25










  • Do you mean when I'm in the staging branch, am I doing git rebase origin master? If so, no.
    – Rod
    Nov 22 '18 at 6:58












  • Does the extra commits that are included in your pull request also include changes to files your pull request wasn't supposed to change? Or are only your changes included, it's just extra commits that you see?
    – Lasse Vågsæther Karlsen
    Nov 22 '18 at 7:24






  • 1




    Then @dunni's answer is likely the right one, someone else is merging to master without going through staging. There's therefore commits on master that isn't in staging, so when you base your branch on master, and then create a pull request towards staging, all commits from master not currently on staging will be included. Go talk to the person that made those commits and see if they are following the guidelines.
    – Lasse Vågsæther Karlsen
    Nov 22 '18 at 7:35






  • 1




    You can do that if you directly merge production to staging before creating your PR for your feature branch. Then you see only the changes from your feature branch.
    – dunni
    Nov 22 '18 at 14:17
















0














Here is my git workflow:




  1. I create a feature branch from production.

  2. Hopefully hours go by (not days) as I make changes to feature branch.

  3. When I'm done...

  4. If days have gone by, I stash my changes.

  5. I'll do a git rebase origin master to pull latest into feature branch.

  6. I'll, then, git stash apply to get my changes back.

  7. I do a commit and then push the changes

  8. Then I create a PR to staging


When I create a Pull Request to staging from my feature branch, for some reason the PR will include other commits that aren't mine.



Question 1: Does the workflow above look normal?

Question 2: Why am I getting extra commits in my PR to staging?










share|improve this question
























  • Are you rebasing from staging to production as well, or just merging?
    – Lasse Vågsæther Karlsen
    Nov 22 '18 at 6:25










  • Do you mean when I'm in the staging branch, am I doing git rebase origin master? If so, no.
    – Rod
    Nov 22 '18 at 6:58












  • Does the extra commits that are included in your pull request also include changes to files your pull request wasn't supposed to change? Or are only your changes included, it's just extra commits that you see?
    – Lasse Vågsæther Karlsen
    Nov 22 '18 at 7:24






  • 1




    Then @dunni's answer is likely the right one, someone else is merging to master without going through staging. There's therefore commits on master that isn't in staging, so when you base your branch on master, and then create a pull request towards staging, all commits from master not currently on staging will be included. Go talk to the person that made those commits and see if they are following the guidelines.
    – Lasse Vågsæther Karlsen
    Nov 22 '18 at 7:35






  • 1




    You can do that if you directly merge production to staging before creating your PR for your feature branch. Then you see only the changes from your feature branch.
    – dunni
    Nov 22 '18 at 14:17














0












0








0







Here is my git workflow:




  1. I create a feature branch from production.

  2. Hopefully hours go by (not days) as I make changes to feature branch.

  3. When I'm done...

  4. If days have gone by, I stash my changes.

  5. I'll do a git rebase origin master to pull latest into feature branch.

  6. I'll, then, git stash apply to get my changes back.

  7. I do a commit and then push the changes

  8. Then I create a PR to staging


When I create a Pull Request to staging from my feature branch, for some reason the PR will include other commits that aren't mine.



Question 1: Does the workflow above look normal?

Question 2: Why am I getting extra commits in my PR to staging?










share|improve this question















Here is my git workflow:




  1. I create a feature branch from production.

  2. Hopefully hours go by (not days) as I make changes to feature branch.

  3. When I'm done...

  4. If days have gone by, I stash my changes.

  5. I'll do a git rebase origin master to pull latest into feature branch.

  6. I'll, then, git stash apply to get my changes back.

  7. I do a commit and then push the changes

  8. Then I create a PR to staging


When I create a Pull Request to staging from my feature branch, for some reason the PR will include other commits that aren't mine.



Question 1: Does the workflow above look normal?

Question 2: Why am I getting extra commits in my PR to staging?







git bitbucket






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 22 '18 at 4:34







Rod

















asked Nov 21 '18 at 22:10









RodRod

5,5601776136




5,5601776136












  • Are you rebasing from staging to production as well, or just merging?
    – Lasse Vågsæther Karlsen
    Nov 22 '18 at 6:25










  • Do you mean when I'm in the staging branch, am I doing git rebase origin master? If so, no.
    – Rod
    Nov 22 '18 at 6:58












  • Does the extra commits that are included in your pull request also include changes to files your pull request wasn't supposed to change? Or are only your changes included, it's just extra commits that you see?
    – Lasse Vågsæther Karlsen
    Nov 22 '18 at 7:24






  • 1




    Then @dunni's answer is likely the right one, someone else is merging to master without going through staging. There's therefore commits on master that isn't in staging, so when you base your branch on master, and then create a pull request towards staging, all commits from master not currently on staging will be included. Go talk to the person that made those commits and see if they are following the guidelines.
    – Lasse Vågsæther Karlsen
    Nov 22 '18 at 7:35






  • 1




    You can do that if you directly merge production to staging before creating your PR for your feature branch. Then you see only the changes from your feature branch.
    – dunni
    Nov 22 '18 at 14:17


















  • Are you rebasing from staging to production as well, or just merging?
    – Lasse Vågsæther Karlsen
    Nov 22 '18 at 6:25










  • Do you mean when I'm in the staging branch, am I doing git rebase origin master? If so, no.
    – Rod
    Nov 22 '18 at 6:58












  • Does the extra commits that are included in your pull request also include changes to files your pull request wasn't supposed to change? Or are only your changes included, it's just extra commits that you see?
    – Lasse Vågsæther Karlsen
    Nov 22 '18 at 7:24






  • 1




    Then @dunni's answer is likely the right one, someone else is merging to master without going through staging. There's therefore commits on master that isn't in staging, so when you base your branch on master, and then create a pull request towards staging, all commits from master not currently on staging will be included. Go talk to the person that made those commits and see if they are following the guidelines.
    – Lasse Vågsæther Karlsen
    Nov 22 '18 at 7:35






  • 1




    You can do that if you directly merge production to staging before creating your PR for your feature branch. Then you see only the changes from your feature branch.
    – dunni
    Nov 22 '18 at 14:17
















Are you rebasing from staging to production as well, or just merging?
– Lasse Vågsæther Karlsen
Nov 22 '18 at 6:25




Are you rebasing from staging to production as well, or just merging?
– Lasse Vågsæther Karlsen
Nov 22 '18 at 6:25












Do you mean when I'm in the staging branch, am I doing git rebase origin master? If so, no.
– Rod
Nov 22 '18 at 6:58






Do you mean when I'm in the staging branch, am I doing git rebase origin master? If so, no.
– Rod
Nov 22 '18 at 6:58














Does the extra commits that are included in your pull request also include changes to files your pull request wasn't supposed to change? Or are only your changes included, it's just extra commits that you see?
– Lasse Vågsæther Karlsen
Nov 22 '18 at 7:24




Does the extra commits that are included in your pull request also include changes to files your pull request wasn't supposed to change? Or are only your changes included, it's just extra commits that you see?
– Lasse Vågsæther Karlsen
Nov 22 '18 at 7:24




1




1




Then @dunni's answer is likely the right one, someone else is merging to master without going through staging. There's therefore commits on master that isn't in staging, so when you base your branch on master, and then create a pull request towards staging, all commits from master not currently on staging will be included. Go talk to the person that made those commits and see if they are following the guidelines.
– Lasse Vågsæther Karlsen
Nov 22 '18 at 7:35




Then @dunni's answer is likely the right one, someone else is merging to master without going through staging. There's therefore commits on master that isn't in staging, so when you base your branch on master, and then create a pull request towards staging, all commits from master not currently on staging will be included. Go talk to the person that made those commits and see if they are following the guidelines.
– Lasse Vågsæther Karlsen
Nov 22 '18 at 7:35




1




1




You can do that if you directly merge production to staging before creating your PR for your feature branch. Then you see only the changes from your feature branch.
– dunni
Nov 22 '18 at 14:17




You can do that if you directly merge production to staging before creating your PR for your feature branch. Then you see only the changes from your feature branch.
– dunni
Nov 22 '18 at 14:17












1 Answer
1






active

oldest

votes


















2















  1. Stashing and reapply after rebasing should not be necessary. Instead, at point 4 you just should do a regular commit. After that you can rebase your commits.


  2. That means, that somebody else is circumventing the process and merging changes to production without going through staging first. It could also be, that when the merge to production happens, actually a squash merge or another operation, which changes the history, is used, which would mean that on a commit level staging and production would be different (not necessarily on content side).







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%2f53421143%2fwhy-am-i-getting-extra-commits-in-my-pull-request%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















    1. Stashing and reapply after rebasing should not be necessary. Instead, at point 4 you just should do a regular commit. After that you can rebase your commits.


    2. That means, that somebody else is circumventing the process and merging changes to production without going through staging first. It could also be, that when the merge to production happens, actually a squash merge or another operation, which changes the history, is used, which would mean that on a commit level staging and production would be different (not necessarily on content side).







    share|improve this answer


























      2















      1. Stashing and reapply after rebasing should not be necessary. Instead, at point 4 you just should do a regular commit. After that you can rebase your commits.


      2. That means, that somebody else is circumventing the process and merging changes to production without going through staging first. It could also be, that when the merge to production happens, actually a squash merge or another operation, which changes the history, is used, which would mean that on a commit level staging and production would be different (not necessarily on content side).







      share|improve this answer
























        2












        2








        2







        1. Stashing and reapply after rebasing should not be necessary. Instead, at point 4 you just should do a regular commit. After that you can rebase your commits.


        2. That means, that somebody else is circumventing the process and merging changes to production without going through staging first. It could also be, that when the merge to production happens, actually a squash merge or another operation, which changes the history, is used, which would mean that on a commit level staging and production would be different (not necessarily on content side).







        share|improve this answer













        1. Stashing and reapply after rebasing should not be necessary. Instead, at point 4 you just should do a regular commit. After that you can rebase your commits.


        2. That means, that somebody else is circumventing the process and merging changes to production without going through staging first. It could also be, that when the merge to production happens, actually a squash merge or another operation, which changes the history, is used, which would mean that on a commit level staging and production would be different (not necessarily on content side).








        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 21 '18 at 22:22









        dunnidunni

        28.4k57182




        28.4k57182






























            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%2f53421143%2fwhy-am-i-getting-extra-commits-in-my-pull-request%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

            404 Error Contact Form 7 ajax form submitting

            How to know if a Active Directory user can login interactively

            Refactoring coordinates for Minecraft Pi buildings written in Python