...
There is no option to just do reorganization of the existing repo and renaming - it will keep all the old references and versions of junk and keep adding to the size, which is uncouth.
Options
To split there are 2 choices, each *should* keep history properly if done right, but it should be easy to see why #1 is far easier given the piles of stuff in nds-labs,
which is 50MB - quite large given what's in there - some due to mistakes and some due to just piles of old junk.
By the way apictl is over 2/3 of the entire size, looks like the binary is the culprit.
...
- Inclusive style - in a clean directory:
- Clone nds-labs to labs.1
- remove the origin from labs.1
- clone labs.1 to labs.2 and remove originn from labs.2
- In labs.2, merge v2
- clone labs.2 to labs.3 and remove it's origin
- Arrange the subdirectory that you want to keep - ignore everything outside of the directory - it doesn't matter.
- Use git mv to move everything under the path you wish to keep
- git rm -f inside the new path - everything that you don't want but ignore anything not under the path - just make that folder nice.
- git commit
- Every time you make a major change you can clone again, in case you discover something down the line you can rm -r the broken clones and redo
- clone the next step: labs3 to labs4 and remove the origin from the new clone
- Keep arranging and commit
- When you're done arranging: You should have some clone of clone of .clone of .... where you are on master and you have one subdirectory where you have
the good stuff and no junk..... - Make one more step-clone
- git filter-branch --prune-empty --subdirectory-filter <path to what you keep>
- Make the repo in git, bare (no readme or anything)
- git remote add origin <github url>
- git push origin master
- Exclusive style:
- Don't try it, it's rough and error prone
- But if you wish, it's a similar clone-change-commit/clone-change-commit/.... process as in inclusuve
- But you need to redact every file and directory that you wish to omit, and it's much easier to setup what you want and split - see Inclusive above.
Moderately complicated example:
The goal - cut the developer-shell out of v2:devtools/Makefiles and v2:devtools/ndsdev into ndslabs-developer-shell
...