I'm new to Git and even newer to Gerrit and got a little bit lost. My workflow was probably standard: create a new branch, do the magic, commit changes, push them to Gerrit's repo.
My newly pushed branch is visible in Gerrit's web UI, but change is not visible at all.
After reading this answer, Gerrit's docs and many more, I easily and quickly found, that I missed magical refs. Instead of git push origin HEAD:refs/for/{branch name}
I did just git push origin
.
Great! But, how to recover from this situation? Whenever I try to push again, this time with proper refs, I'm getting ! [remote rejected] (no new changes)
.
What does this mean and what can I do? Does it mean, that I can't fix this in any other way, than adding new changes, committing them and pushing again? (no, even pushing another commit didn't solve the problem, Gerrit merged new push into master, but completely dropped previous one; this is beyond my imagination, unfortunately!)
You can:
git push origin :<branch>
,git reset --soft HEAD^
,git stash
,git push origin <branch>
,git stash pop
,refs/for/<branch>
.