Combining multiple git repositories

后端 未结 13 1380
眼角桃花
眼角桃花 2020-11-22 15:34

Let\'s say I\'ve got a setup that look something like

phd/code/
phd/figures/
phd/thesis/

For historical reasons, these all have their own g

13条回答
  •  天涯浪人
    2020-11-22 16:19

    The git-filter-branch solution works well, but note that if your git repo comes from a SVN import it may fail with a message like:

    Rewrite 422a38a0e9d2c61098b98e6c56213ac83b7bacc2 (1/42)mv: cannot stat `/home/.../wikis/nodows/.git-rewrite/t/../index.new': No such file or directory
    

    In this case you need to exclude the initial revision from the filter-branch - i.e. change the HEAD at the end to [SHA of 2nd revision]..HEAD - see:

    http://www.git.code-experiments.com/blog/2010/03/merging-git-repositories.html

提交回复
热议问题