Git - tidying up a repo

Posted by Simon Woods on Stack Overflow See other posts from Stack Overflow or by Simon Woods
Published on 2010-05-06T12:34:52Z Indexed on 2010/05/06 12:38 UTC
Read the original article Hit count: 428

Filed under:
|
|

Hi

I have got my repo into a bit of a state and want to be able to work my way out of it

The repo looks a bit like this (A1, B1, C1 etc are obviously commits)

                  A1 ---- A2 ---- A3 ---- A4 ---- A5 ---- A6 ---- A7 ---- A8
                                                                  /
(from a remote repo)  B1 ---- B2 ---------------------------------  
                              | \
                              \  C1 ---------------------------------C2 
                               \                                     /
                                D1 --- D2 --- D3 --- D4 --- D5 --- D6

Ideally I'd like to be able to remove all the revisions (with rebase?) on the B, C and D lines (I'm loathed to say branches simply because there are now no local branches on these lines except ref branches to the remote repo) and try to merge in the remote repo again, perhaps in a better way.

I'd be grateful of any suggestions as to how to get rid of all these commits. Could I ask that any answers use revision SHA1s rather than branch names. I thought that somehow I'd be able to revert the merge into A7 but can't quite work out how to do it

I hope that is sufficient information. Many thx

Simon

© Stack Overflow or respective owner

Related posts about git

Related posts about tidy