4

After streamlining the history of a Git branch using git rebase -i, I'm having some trouble with remotes:

$ git push remote-name branch-name
CONFLICT (add/add): Merge conflict in ...
error: failed to push some refs to 'ssh://...'
$ git pull remote-name branch-name
...
Automatic merge failed; fix conflicts and then commit the result.
$ git mergetool
$ git commit -m "Merge"

Now the history of the branch is messed up, with my commits appearing twice (parallel lines in gitk) after some seemingly arbitrary point before my first commit. I've tried git rebase -i, but now it complains that it "Could not apply 123abc...". How do I get rid of the parallel commits?

1 Answer 1

6

You did something wrong, but I'm having a hard time understanding what. One possibility is that you rebased something that you already pushed, and then tried to push it again. This is a big no-no, you should never rebase something that you've already pushed to a remote repo, or you'll run into various issues. Here's a short explanation of it

2
  • That's exactly it. Since I'm the only user of the target repo, I thought there would be a simple way of fixing this. Looks like I was wrong.
    – l0b0
    Feb 4, 2010 at 8:25
  • 4
    Oh...if you're the only user, then you can use the '-f' flag when you push, it'll just overwrite all the changes on the target repo. It's just not recommended as above.
    – davr
    Feb 4, 2010 at 20:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .