I am buried deep within a git.
How did I get there:
I am not a git expert. Please do ask me a clarification if I lack any detail. I ran following commands few days ago to push my changes to remote branch.
% git checkout master
% git pull
% git checkout redactor_changes <-- this is the branch that I made my changes
% git commit -m "changes" # I added my changes previously
% git rebase master
% git push origin redactor_changes # pushed changes to remote branch
Not every one has the write permission to merge changes to master branch. The guy who has the write permission on remote repo told me there is a conflict and do a rebase and submit again. So today I ran following commands in exact order.
vagrant@vagrant-ubuntu-trusty-64:~/oblog$ git add oblog/static/css/styles-custom.css
vagrant@vagrant-ubuntu-trusty-64:~/oblog$ git add oblog/static/js/redactor.upload_image.js
vagrant@vagrant-ubuntu-trusty-64:~/oblog$ git add oblog/static/images/loading.gif
vagrant@vagrant-ubuntu-trusty-64:~/oblog$ git commit -m "Throw a toast when user upload an non-image file with image extension"
vagrant@vagrant-ubuntu-trusty-64:~/oblog$ git branch
vagrant@vagrant-ubuntu-trusty-64:~/oblog$ git checkout master
vagrant@vagrant-ubuntu-trusty-64:~/oblog$ git pull
vagrant@vagrant-ubuntu-trusty-64:~/oblog$ git checkout redactor_changes
vagrant@vagrant-ubuntu-trusty-64:~/oblog$ git rebase master
vagrant@vagrant-ubuntu-trusty-64:~/oblog$ git merge master
vagrant@vagrant-ubuntu-trusty-64:~/oblog$ git branch
vagrant@vagrant-ubuntu-trusty-64:~/oblog$ git push origin redactor_changes
Its looks like this set of command sucked me into a whirlpool that I can't escape.
Symptoms:
Last line of the above code throws following error
! [rejected] redactor_changes -> redactor_changes (non-fast-forward)
error: failed to push some refs to 'https://git.<domain>.com/web/oblog.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.
So I followed advice from fellow SO
but the problem still persist.
LABLE:
When I rebase my branch with master(locally), it throws some conflicts which I then manually fix and do a rebase --continue. Rebase was successful. Then I push my branch again to origin, it showed me same error, ! [rejected].
As suggested by git and SO, I go on the pull the changes on my remote branch to my local branch ( redactor_changes). Then executed
git rebase master
which puts me back on the the LABEL. This just goes on and on.
Note that my push command work if I don't rebase it with master, but owner of the remote git would still see the conflict when he tries to merge my branch (redactor_changes) onto master.