We have a develop branch where we build features and then make PR targeting the develop branch and merge them in.
Then we merge the develop branch into a release branch. We use this release branch to QA test.
This release branch then gets merged into our prod branch, to know what's going on in our live version of the product and keep track.
the script we run for release is just:
git checkout release
git pull origin develop
git push release
Nothing fancy. and I've been doing this for a good amount to know it's pretty routine...
but then yesterday I ran the same script and got this error:
warning: Pulling without specifying how to reconcile divergent branches is
discouraged. You can squelch this message by running one of the following
commands sometime before your next pull:
git config pull.rebase false # merge (the default strategy)
git config pull.rebase true # rebase
git config pull.ff only # fast-forward only
You can replace "git config" with "git config --global" to set a default
preference for all repositories. You can also pass --rebase, --no-rebase,
or --ff-only on the command line to override the configured default per
invocation.
I've never seen this error before. So I manually ran the script actions, but instead of git push, I rebased. That got me so merge conflicts that needed to be resolved.
After resolving the conflicts, I saw that old commits (that were already merged in from way before (like few months ago?) showed up at the top of the commit history. The only commits that I should see in the release branch are "Merge pull request #XXX from /develop".
I don't even know where to look to see what the problem is. I don't know where it went wrong. I checked the PRs that were merged in to develop branch since the last time the release branch pulled from develop, and they all targeted develop as they should....