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.

Due to some reasons, I re-combined some previously splited Git repositories. (Using git-stitch-repo) Some commits are made across several sub-projects. And after re-combined, they are shown in duplicated entries.

I want to merge these duplicated commits in sequence, like uniq does.

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

If your commits are duplicate within the same branch, you can try a git rebase --interactive to trim/squash them (But it is not an automatic way to remove them, like some kind of uniq command)

The OP Xiè Jìléi asks:

Can I prepare an edit list by hand, and then send to rebase -i?

To which Max Nanasy replies:

GIT_EDITOR='cat "$EDIT_LIST" > ' git rebase -i "$REBASE_START"
share|improve this answer
    
Can I prepare an edit list by hand, and then send to rebase -i? –  Xiè Jìléi Jan 8 '11 at 9:28
    
@谢继雷: I don't think so, but it could be the base for an interesting question of its own ;) –  VonC Jan 8 '11 at 9:33
1  
@XièJìléi GIT_EDITOR='cat "$EDIT_LIST" > ' g rebase -i "$REBASE_START" seems to work –  Max Nanasy Nov 5 '12 at 6:26
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.