We have a remote repo with different versions v1 through to v4, we have now gone live with v4 and are starting work on v5. 90% of all the code was created in v4. One of our devops cut a new v5 branch from master but it is missing all of v4 code.
I have checked out v5 and did the following command to merge v4 into it.
git merge v4
During which it scrolls through all of the changes we made in v4, so definitely looks good.
if I then do a
git status
it tells me that
Your branch is ahead of origin/v5 by 44 commits.
(use "git push" to publish your local commits)
nothing to commit, working tree clean
which seems to contradict itself?
I then attempt to push to v5 with
git push origin HEAD:refs/for/v5
and it returns:
Total 0 (delta 0), reused 0 (delta 0)
remote: Processing changes: refs: 1, done
followed by:
! [remote rejected] HEAD -> refs/for/v5 (no new changes)
error: failed to push some refs to '......'
No doubt I'm missing a step or have done something wrong but I can't quite work out what?
question from:
https://stackoverflow.com/questions/65641513/ahead-by-x-commits-following-merge-but-cannot-push 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…