0

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…

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.

4
  • git push -f origin develop Commented May 10, 2018 at 23:18
  • 1
    As suggested in this SO answer, it is a bit safer to use --force-with-lease in lieu of -f: git push --force-with-lease origin develop Commented May 10, 2018 at 23:20
  • Thanks @ErikMD, that seems best in both ways. Commented May 10, 2018 at 23:46
  • Anyone know how to change the duplicate link to the one ErikMD suggests? Commented May 10, 2018 at 23:48

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.