Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

1 Answer 1

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
2  
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.