Reputation: 13959
Ahhh I remember those days when I was a git newbie and I commited all those big library files along with my projects...
But now I'm trying to ressurect an old project like this, and I want to "purify" my repository stored on my school's server (and hell, it was hard to download those MB in one shot without the fetch failing in the middle !)
By "purify", I mean that I'd like to make an other repository from the existing one, if possible maintaining the "commits/branch" structure, but getting rid of some files/folders of my choosing.
In details, let's say I have this big folder /lib/
along with eventually some other ones, that I want to totally separate. But if possible, I'd like to have a clean, reversible separation : in every commit, I should keep some hash or whatever may give me a hint as to what the content of the /lib
folder was.
The ideal solution would be to have two repositories that are always synchronized and with the "same commits"
/lib folder
/lib/
folderIn other words, what I'm trying to do is recreate artificially some kind of dependency manager (If only I had started a maven or so straight from the start.. sigh)
In a nutshell two steps :
/lib
deltas, some info or pointer where I can find information on the files that were previously there (or maybe a link to another commit of a repo who would only contain the evlution of the /lib
folder ?Upvotes: 0
Views: 37
Reputation: 12547
I believe you should apply interactive rebase approach.
You can mark commits that contain some library code with edit
tag. While rebasing you will be able to drop that libarary code and change commit message to point your original commit code.
Upvotes: 1