0

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

  • I have not seen the message in front of me but I have seen questions about it pop up recently and I wonder if there was an intended change introduced in git recently to kind of force people into configuring something specifically? Anyway... can you provide: `git version; git config -l --global; git config -l` – eftshift0 Dec 09 '22 at 13:45
  • Just in case, take a look at this: https://stackoverflow.com/questions/62653114/how-can-i-deal-with-this-git-warning-pulling-without-specifying-how-to-reconci – eftshift0 Dec 09 '22 at 13:54
  • @eftshift0 that would be wild if a change in git was the issue. Last time I made this change to the `release` branch was over 24 days ago, right around when that SO question was posted. My git version is `git version 2.37.1 (Apple Git-137.1)`, – ordosalutis Dec 09 '22 at 14:28
  • I got `2.37.2` and I am yet to see that message. – eftshift0 Dec 09 '22 at 17:00
  • `warning: ...` is not an *error* and Git went ahead and did what you asked. This will eventually be an error, but at the moment, it is not your problem. Your problem here is that you haven't paid careful attention to precisely what both `git rebase` does *and* to what `git pull` does. Git gets very bitey and becomes an uncontrollable dog if you don't lead it correctly. – torek Dec 10 '22 at 09:36
  • We'll need to know more about *exactly* what you did, in exactly what order, to say more. If you just want to fix the mess, we still need to know more, e.g., to see the repository in question, or perhaps just `git log --all --decorate --oneline --graph` output. – torek Dec 10 '22 at 09:38

0 Answers0