Move some files, with all history, from one project into a new one
- From
- Kerry, Richard <richard.kerry@atos.net>
- Date
- Apr 15, 2020, 08:31 UTC
- Message-ID
- <AM0PR02MB3715F9566BD9FEFAF832F0749CDB0@AM0PR02MB3715.eurprd02.prod.outlook.com>
I would like to move some files, from the project in which they have always resided into a new project. I would like to keep all their history. I don't want to waste space by also moving the rest of the old project's history, or historical file contents.
We have a long-standing project, main-system. A group of files within it are designated as demo-system (sometimes whole folders, sometimes files within folders with other files). All development is done on the master branch. It has now transpired that the demo-system files are necessary, but no longer want to be within main-system but in a new project of their own. So I would like to move them from the main-system repo into a new repo of their own. I do want all their history but I don't want to take any contents from other files from main-system, which is quite big. Please can someone advise if there is a particular method I should best use for this. Do I create a new branch, then delete the rest of main-system leaving only what I want? Surely if I do that then I would end up with all the main-system file data within the new repo, which would expand its size. Is there a recommended way to extract certain files with their histories?
Regards, Richard.