0

I have a single repository with all my MATLAB codes in it, with several subdirectories. Now I want to publish a part of it, so I have to isolate some files and subdirectories (without detaching them from the main repository) and push them to a new repository which will be made public. To clarify, let's say this is my main repository:

.git/
MATLAB_Codes/
   folder_A/
      aaa.m
      bbb.m
      ccc.m
      ddd.m
   folder_B/
      eee.m
      fff.m
      ggg.m
      hhhh.m
   iii.m
   jjj.m
   kkk.m
   lll.m

now I want to create a new repository which should look like this:

.git/
Project_alpha/
   folder_A/
      aaa.m
      bbb.m
   folder_B/
      eee.m
      fff.m
   iii.m
   jjj.m

with all the related histories. From my search, I think I cannot use subtree since I have more than one subdirectory, and perhaps git filter-branch is the way to go, but it gets a bit complicated for me when I want to put everything together and implement this.

Your help would be very much appreciated!

  • 1
    Does [this](https://stackoverflow.com/a/37037151/1016216) help? – L3viathan Jun 27 '19 at 10:54
  • okay, first of all, pull all the code of first repo. after this remove first rep's remote and add other ones which you want to push data to in and simply push data in this new repo. – Pavan Nagadiya Jun 27 '19 at 11:39

0 Answers0