Thank you! I too got into a similar situation as the above. Probably due to my mistake. To simplify I have recently done a change similar to the comments above (I believe) like this and got into a similar situation. Essentially a combination of branch renaming, default branch designations, and reusing an old branch from a previous git workflow in a new context.
Here’s an example here at GitHub - shermaneric/test_headsup6
1. main -> switch default branch to prod
git branch -m main prod
git fetch origin
git branch -u origin/prod prod
git checkout main. # to do more dev work here
git push origin main
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 4 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 269 bytes | 269.00 KiB/s, done.
Total 3 (delta 1), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (1/1), completed with 1 local object.
remote: Heads up! The branch 'main' that you pushed to was renamed to 'prod'.
f0d0b44..e234721 main -> main
Like the others, everything “works”. I’ve set my upstream of main to origin/main and
HEAD is tracking properly. The git commits are going to the right branches but the heads up slightly takes me off guard
I totally get it though if this is intended behavior - and reusing old renamed branches for new purposes probably isn’t the best idea. I’m trying to think of a way to rebase my history in a way to avoid this (I’m also trying to repro this) but would rather not spend the calories if at all necessary.