Hacker News new | comments | show | ask | jobs | submit login
Moving Files from one Git Repository to Another, Preserving History (gbayer.com)
27 points by gregbayer 2229 days ago | hide | past | web | 5 comments | favorite



An excellent tool I have used for similar purposes in the past (although it can do other things as well) is git-subtree. I recommend checking it out: https://github.com/apenwarr/git-subtree

Edit a more useful page: https://github.com/apenwarr/git-subtree/blob/master/git-subt...


That was my thought as well, but then I thought that the requirements might be different here. git-subtree would allow you to create a git repository (with history) from a directory in a pre-existing repository. You could them just 'git rm -r' the directory from the original repository, but I'm not sure if the requirements here are to completely remove the history of that directory from the original repository too (because git-subtree doesn't do that, to my knowledge).


I agree, git-subtree doesn't quite do what they do in this blog post, but it covers similar ground and is really easy to use in comparison.


Thanks! git-subtree looks very useful. Have you used it extensively? Any gotchas?


I haven't used it enough to really give you any gotchas. It has let me open source some stuff to github really easily though.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: