wingolog

merging in unrelated git branches

14 October 2008 3:57 PM (git | merge | hackery | history | fabrication)

Sometimes when you develop code outside the "official" repository for some project, it turns out that after a few months of hacking, your code is actually suitable for inclusion in the mainline.

Typically when this is the case, the code is just imported directly, throwing away the historical records of how that code came to be.

This is a travesty. Not only is the future deprived of the past, you as a hacker do not get sufficient recognition of your efforts. (What good are perfect patches if you do not reap their accolades?)

But suffer not: while Git does not support direct merges between unrelated branches, it can be made to comply. Script here: git-merge-unrelated-branch. (Example commit.)

Be not deprived of your just deserts!

17 responses

  1. Maciej Piechotka says:

    It seems to support:
    60ce752c in git://github.com/uzytkownik/gnome-overlay.git
    How the branches may be more unrelated (or I misunderstood something).

  2. Elijah Newren says:

    I thought 'eg pull REPO BRANCH' did this just fine; I've used it a time or two to merge branches with no common history. Are there problems in less simplistic cases that need your script?

  3. Elijah Newren says:

    Um, er, I mean 'git pull REPO BRANCH'. Same thing, though.

  4. Andy Wingo says:

    Well ain't I the fool! Elijah it does appear to work; although I normally use fetch + merge, that seemed to work as well.

    I swear that a few months ago when I first tried this, it did not do the right thing, erroring out when I went to merge. I tried all merge strategies, even. May my crufty script rot in obscurity, then.

  5. Sam Vilain says:

    It can support those well actually, just set up a graft and you can fake the history being joined in the past. See Documentation/repository-layout.txt in the git distribution. You can later make it permanent with git-filter-branch.

  6. yahtzee online says:

    Guys just click and enjoy of free online yahtzee game website which has lots of funny and gorgeous amazing games. Thanks a lot for allow me comment here i am giving a link for online game lover.

  7. shadow fight 3 cheats says:

    get free unlimited gems and gold on shadow fight 3 with shadow fight 3 cheats online.

  8. essay services reviews says:

    Some projects are come to teach you many things like how you can complete them at a low budget. These are our learning material which we have to use it.

  9. Buy Viagra Online says:

    Well ain't I the fool! Elijah it does appear to work; although I normally use fetch + merge, that seemed to work as well.

  10. Generic Viagra says:

    Buy Viagra online! All tablets dosages available today. Lowest Prices. Cheap pills online. 100% Satisfaction Guaranteed! Licensed and Generic products.

  11. Comprar Viagra Genérico En España says:

    Comprar Viagra Genérico En España! All tablets dosages available today. Lowest Prices. Cheap pills online. 100% Satisfaction Guaranteed! Licensed and Generic products.

  12. desalescollege says:

    Safety in your hands and you need to secure your self from those things which harm you. You doing good work by providing the tips for it.

  13. https://scamfighter.net/review/boomessays.com says:

    Looking for the best writing service online but lost in the number of fake reviews and don’t know who to believe? We at ScamFighter publish only genuine reviews on all writing service from the web.

  14. twitter pva accounts says:

    you probably did a high-quality job right here and thanks for shearing such a blog.This specific put up is definitely very interesting. It has a surely great peace of facts.

  15. upcatfeeders com says:

    A lot of people buy cat feeders which looks not good. And I always recommend them to read reviews first then buy it.

  16. <a href="http://godinh.com/"> Gỗ Đỉnh</a> says:

    Thanks for sharing

  17. Gỗ Đỉnh says:

    Thanks for sharing

Leave a Reply