I cloned a brand-new repo from our server. I then pulled a new branch from origin. I made a few changes and committed, but when I try to push, I get the "updates were rejected because the tip of your current branch is behind" error. But it's not - it's a brand-new clone, and there have not been any commits made by other devs in the interim. I've tried doing git pull --rebase
as suggested here, but it just tells me my branch is already up-to-date.
How can I resolve this issue?
estrom@T460-ESTROM MINGW64 /c/gitRepo/qo6 (master)
$ git fetch origin
estrom@T460-ESTROM MINGW64 /c/gitRepo/qo6 (master)
$ git checkout -b estrom/PH-19312 origin/release-18.9.0
Branch estrom/PH-19312 set up to track remote branch release-18.9.0 from origin.
Switched to a new branch 'estrom/PH-19312'
estrom@T460-ESTROM MINGW64 /c/gitRepo/qo6 (estrom/PH-19312)
$ gitk
estrom@T460-ESTROM MINGW64 /c/gitRepo/qo6 (estrom/PH-19312)
$ git commit -am "PH-19312 hide calories for literacy item in order history"
[estrom/PH-19312 5ace4de] PH-19312 hide calories for literacy item in order history
1 file changed, 2 insertions(+)
estrom@T460-ESTROM MINGW64 /c/gitRepo/qo6 (estrom/PH-19312)
$ git push
To ssh://stash.mycompany.com:7999/phi/qo6.git
! [rejected] estrom/PH-19312 -> estrom/PH-19312 (non-fast-forward)
error: failed to push some refs to 'ssh://git@stash.mycompany.com:7999/phi/qo6.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
estrom@T460-ESTROM MINGW64 /c/gitRepo/qo6 (estrom/PH-19312)
$ git pull --rebase
Current branch estrom/PH-19312 is up to date.
estrom@T460-ESTROM MINGW64 /c/gitRepo/qo6 (estrom/PH-19312)
$ git pull --ff-only
remote: Counting objects: 28, done.
remote: Compressing objects: 100% (16/16), done.
remote: Total 16 (delta 11), reused 0 (delta 0)
Unpacking objects: 100% (16/16), done.
From ssh://stash.mycompany.com:7999/phi/qo6
34e51c0..6a7696a PH-18381-18.10 -> origin/PH-18381-18.10
fa0520a..6665db3 develop -> origin/develop
* [new branch] PH-19548 -> origin/PH-19548
Already up-to-date.
estrom@T460-ESTROM MINGW64 /c/gitRepo/qo6 (estrom/PH-19312)
$ git push
To ssh://stash.mycompany.com:7999/phi/qo6.git
! [rejected] estrom/PH-19312 -> estrom/PH-19312 (non-fast-forward)
error: failed to push some refs to 'ssh://git@stash.mycompany.com:7999/phi/qo6.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
estrom@T460-ESTROM MINGW64 /c/gitRepo/qo6 (estrom/PH-19312)
$
ETA: result of `git branch -v -v --list estrom/PH-19312
estrom@T460-ESTROM MINGW64 /c/gitRepo/qo6 (estrom/PH-19312)
$ git branch -v -v --list estrom/PH-19312
* estrom/PH-19312 5ace4de [origin/release-18.9.0: ahead 1] PH-19312 hide calories for literacy item in order history