Assuming that you have strictly linear history of your commits (no merges), you can simply export all your commits as follows:
git format-patch <start>..<stop>
Where start
and stop
is range of commits you need (start
is commit you started from, and stop
is probably current HEAD
).
This will create lots of files named NNNNN-commit-description.patch
, NNNNN is number starting from 00001.
Then, create new empty repository and import these patches:
git init newrepo
cd newrepo
find <oldrepo>/*.patch | xargs git am
Also, instead of starting off empty repo, you may want to make first commit with some original files that you depend upon, such that all your patches can apply cleanly.