Multiple repositories in one directory (same level) - is it possible?

前端 未结 7 643
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-06 08:12

My original problem is that I have a directory where I write various scripts. Each of them is independent of others, and usually one-file-long. I want to have some versioning ap

7条回答
  •  既然无缘
    2021-02-06 08:30

    UPDATE (2016): Apparently, a guy named Cosmin Apreutesei created a tool named multigit, which seems to implement what I wished for in this question! If you ever read it, thanks a lot Cosmin! I've started using your tool this year and find it awesome.


    I'm starting to think of some kind of an overlay over Mercurial/git/... which would keep a couple "disabled" repository meta-directories, let's say:

    .hg1/
    .hg2/
    .hg3/
    

    etc., and then on hg commit FILENAME would find the particular .hgN that is linked to FILENAME, and would then temporarily:

    mv .hgN .hg
    hg commit FILENAME
    mv .hg .hgN
    

    The main disadvantage is that it would require me to spend some time writing the tool. Or does anybody know of some ready-made one like this? If you do, please post as a full-featured answer (not a comment), I'm more than willing to accept it.

提交回复
热议问题