Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 4 down vote accepted

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

share|improve this answer
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 '10 at 8:25
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 '10 at 20:29

You must log in to answer this question.

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