Why am I getting extra commits in my pull request?
Here is my git workflow:
- I create a feature branch from production.
- Hopefully hours go by (not days) as I make changes to feature branch.
- When I'm done...
- If days have gone by, I stash my changes.
- I'll do a
git rebase origin master
to pull latest into feature branch. - I'll, then,
git stash apply
to get my changes back. - I do a commit and then push the changes
- 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
|
show 2 more comments
Here is my git workflow:
- I create a feature branch from production.
- Hopefully hours go by (not days) as I make changes to feature branch.
- When I'm done...
- If days have gone by, I stash my changes.
- I'll do a
git rebase origin master
to pull latest into feature branch. - I'll, then,
git stash apply
to get my changes back. - I do a commit and then push the changes
- 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
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 doinggit 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
|
show 2 more comments
Here is my git workflow:
- I create a feature branch from production.
- Hopefully hours go by (not days) as I make changes to feature branch.
- When I'm done...
- If days have gone by, I stash my changes.
- I'll do a
git rebase origin master
to pull latest into feature branch. - I'll, then,
git stash apply
to get my changes back. - I do a commit and then push the changes
- 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
Here is my git workflow:
- I create a feature branch from production.
- Hopefully hours go by (not days) as I make changes to feature branch.
- When I'm done...
- If days have gone by, I stash my changes.
- I'll do a
git rebase origin master
to pull latest into feature branch. - I'll, then,
git stash apply
to get my changes back. - I do a commit and then push the changes
- 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
git bitbucket
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 doinggit 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
|
show 2 more comments
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 doinggit 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
|
show 2 more comments
1 Answer
1
active
oldest
votes
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.
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).
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
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).
add a comment |
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.
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).
add a comment |
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.
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).
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.
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).
answered Nov 21 '18 at 22:22
dunnidunni
28.4k57182
28.4k57182
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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