1

I am creating a new project, but want to add files from an older git repo. I want to add a bunch of files form the old project to the new one but wish to retain the history of those files in addition to putting the new project onto a git repo as well.

What is the right way to do it? I have searched for ways to move files, but then, I need a new git repo with the history from older files, how can I accomplish that?

NSF
  • 1,752
  • 1
  • 18
  • 43

2 Answers2

2

try the method posted here. It should fit your problem.

http://saintgimp.org/2013/01/22/merging-two-git-repositories-into-one-repository-without-losing-file-history/

In this case the author is moving all files to a new subdirectory. In your case you should only move the files to the subdirectory you want. After that you can handle your old files and the new project as separate subdirectories.

Best Regards

typie34
  • 348
  • 4
  • 12
1

You can try the suggestions mentioned in the post.

Moving Files from one Git repository to another preserving the history

Git: Copy a file or directory from another repository preserving the history

Bhavya Shaktawat
  • 2,466
  • 1
  • 10
  • 11
  • there is a similar thread as well.. http://stackoverflow.com/questions/1365541/how-to-move-files-from-one-git-repo-to-another-not-a-clone-preserving-history – Bhavya Shaktawat Nov 29 '14 at 17:57