首页 > 解决方案 > Git rebase again then push (again) is rejected

问题描述

I put in a pull request a while ago to an open source project. The change wasn't rejected as such, just left hanging. I returned to it today because I encountered errors related to that same block of code. I wanted to check my changes were still non-breaking before I add some comments (along the lines of "is anything ever going to happen with this?") Here's what I did: (I do my work on a develop branch and I start on master)

git fetch upstream
git merge upstream/master
git co develop
git rebase upstream/master

I was left with a difference in a submodule so I ran

git submodule update

Ran the tests, all green. Go to push…</p>

git push origin develop

To https://github.com/yb66/ffi.git  
 ! [rejected]        develop -> develop (non-fast-forward)  
error: failed to push some refs to 'https://github.com/yb66/ffi.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.  

I must confess some ignorance, I've never bothered to learn about fast-forwarding. I know, I'm a bad person. I am about to read a couple of articles on it but as is ever the rule with git, knowing the theory will not magically make its interface correspond to my desires. I will still not know what's the best action to take in this specific instance. I will just understand what (hopefully) you will tell me to do instead of running it blindly.

I've already published my changes, I need to update them, what's the best course of action from here? If it was my own project I'd delete the branch, start a new pull request and reference the old one, but that's my laziness mixed in with impatience.

Feel free to scold me for these traits too, Larry Wall was half right.

标签: git

解决方案


推荐阅读