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!