Rod
Rod

Reputation: 15457

Why am I getting extra commits in my pull request?

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?

Upvotes: 0

Views: 923

Answers (1)

dunni
dunni

Reputation: 44535

  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).

Upvotes: 2

Related Questions