Levin Du <zslevin@xxxxxxxxx> writes: > Since A & B share many common files, to save disk space, I'd like to merge them: > (note: branch of A & B are independent, i.e. have no common ancestor.) Not having any shared history is exactly the cause. If the optimization were to exchange list of all the commits, blobs and trees each side has and sending only the ones that the receiving end lacks, you would get the result you seem to be expecting, but that approach is not taken because it is impractically expensive. Instead, the object transfer is optimized by comparing what commits each side has and sending trees and blobs that are reachable from the commits that the receiving side does not have. This approach does not have to exchange the list of trees and blobs at all, and in a pair of repositories for the same project, it does not even have to send the list of all commits, because traversing from the tips of histories and exchanging more recent ones iteratively is expected to find commits common to both and because of the history graph is a DAG, we know what is behind commits that are common exist on both ends. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html