How do I "unnest" git folders?
I have a component, which was uploaded into GitLab. I want to include part of that code into a brand new GitLab repo.
When I include a /code/ folder into a new Git repo, it's tells me that the folder is in a Nested Root
state. I'm using SmartGit, where it seems to show a bundle for the files, instead of individual folders & files.
When I try to add it into GitLab using SmartGit, it want's to create a Sub-Module to my original component, which is also in GitLab. I don't really want to link it between the current /cleanRepo/
and any /existingRepo/
. I know that SVN used to have a lot of hidden .properties files. Git seems to have those as well. So I probably need to make it forget about all of the previous repo's Git information.
Backstory / Reason: I want to re-use some of a finished component's code in all of my brand new components, which I want to build in the future. I don't want to copy & paste a fully built component's code into a new folder, whenever I clone a new repository & want to build a new component. I don't want to have to delete what shouldn't be in that new component, every time that I make a new component. So I want to create a clean repository with a master copy of the starting code. Let's say it contains 1/3 of a fully-built component's code. I'm going to copy that clean/master code folder into each new Git repository folder. Then I'm going to go into my new component's folder to extend the copied code in that folder. This would make a nice clean cookie cutter approach to building new components, where I can avoid deleting a plethora of files & editing multiple files, to delete large swathes of code.
Ideal Example:
cd /cleanRepo/code/
cp -R ./* ~/someNewFolder
cd ~/someNewFolder
^-- start editing that code, but don't edit any /cleanRepo/code/
Is there an easy way to "unnest" git folders? I want to see a list of folders & files, that I'd like to include. Not a "Nested Root" bundle.