git archiving old folders

1

i have a big git repo with some old folders in there. i dont need them in my master branch and they are a little bit annoying there but i dont want to loose the data, so archiving would be great. now i miss a feature (or i dont know it yet) which can move them to a seperate branch or something in that way... it would be nice to see only my needed folders in the master branch and have another branch "archive" for all the old stuff... i know that branches are not made for this, so may there is another way? Also i dont want to tar these folders, so it would be great to have them not compressed.

reox

Posted 2011-09-06T19:08:39.947

Reputation: 915

Answers

2

You could take your master branch and branch it off into "archive", pull the "archive" branch, delete the files and folders you don't want in there then go back to your master branch and delete the files and folders you kept in the "archive" branch.

Nexerus

Posted 2011-09-06T19:08:39.947

Reputation: 798

mh yes that was also my first idea, so is there nothing else builtin? – reox – 2011-09-06T19:17:32.323

Not that I know of, unless you want to create a tag to be able to pull those folders out after they were deleted, but with a branch you could probably merge other branches into it when you want to add more to the archive branch. – Nexerus – 2011-09-06T19:21:07.483

okay, so how i move now a folder in my archive branch? git checkout archive; git checkout <myfolder> master; git commit -am "<...>"; git checkout master; git rm <myfolder>; git checkout -am "<...">; ? – reox – 2011-09-06T19:33:31.147