I have a GitHub repository https://GitHub.com/JohnBurger/Edison.
Inside it there are many subdirectories with modules specific to the Intel® Edison - but some that are more generic. In fact, I now have an Arduino project that could take advantage of some code in that repository, so I thought I'd fork a new repository https://GitHub.com/JohnBurger/Arduino, from Edison
. Only, when I try, GitHub simply doesn't do it. I click "Fork", it thinks about it, and then... nothing. I reckon that's because the source is already mine, and I don't get the opportunity to rename the new fork.
I figure what GitHub wants me to do is clone it into a separate local directory, then create a new repo for it and commit it back into the new one - but will that maintain the full history?
Actually, what I really want to do is be selective about which parts of the directory hierarchy to keep and which to jettison (as in, completely remove). For example, say the existing repo looks like this:
Edison/
Dir1/
Dir2/
Dir3/
SubDir1/
SubDir2/
Dir4/
I want a new repo to look like:
Arduino/
Dir2/ [from Edison]
Dir3/ [from Edison]
SubDir2/ [from Edison (note SubDir1 is missing)]
Dir5/ [new to this Project]
with all of the history of the included directories, but none of the irrelevant baggage from Edison
.
Ideal
But, if I'm really wishing I'd actually want a third repo:
General/
Dir2/
Dir3/
SubDir2/
Edison/
[link to General/]
Dir1/
Dir3/
SubDir1/
Dir4/
Arduino/
[link to General/]
Dir5/
That way:
General/
still has all the changes I made while developingEdison/
.- If I make future changes to anything in
General/
, then bothEdison/
andArduino/
will benefit. - Anyone simply getting either
Edison/
orArduino/
would get the whole shebang, ready to compile.
But I don't know if Git works like that... or if I can still have per-architecture specific branches of certain files within those directories.
If it can, though, could someone please provide the instructions to:
- Create
General/
fromEdison/
, maintaining history; - Remove
General/
fromEdison/
, purging history; - Linking
General/
intoEdison/
; - Creating
Arduino/
and linkingGeneral/
into it; - How to have architecture-specific versions of files within
General/
.
That would be ideal, thanks!