I've cloned repository A's master branch from git and created my own branch called Li.
I've made some changes a while ago and pushed the contents of local Li to remote Li.
Now I've pulled some updates from remote master to my local master branch and from the local master branch to the local Li, and I'm trying to push the updates from local Li to remote Li.
However, when I try to run:
git checkout Li
git push origin Li
I get the following error:
error: failed to push some refs to '[email protected]:anodejs/system.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
Note that my local master branch is updated (I invoked git pull origin master) and merged into the local Li branch. I did, however, add local Li a new file, so local Li is not identical to local master (but this shouldn't matter, right?)
Thanks,
Li
question from:
https://stackoverflow.com/questions/11935043/git-error-when-trying-to-push-to-remote-branch 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…