1

Let's say I've been using a small free/open-source code library for a few years, and the project's maintainer/developer does not use any version control system. Instead, new releases are added to a publicly-accessible directory on an ftp server (in other words, the way free software used to be distributed). Consequently, I now have a folder on my local machine that contains several versions (i.e., whole copies) of the code library. For example:

 

/foo
    /foo_v0.1.0.zip
    /foo_v0.1.1.zip
    /foo_v0.2.0.zip
    /foo_v1.0.0.zip
    /foo_v1.0.1.zip
    /foo_v1.1.0.zip
    /foo_v2.0.0.zip

 

Now let's say I wanted to convert this into a git repository and push it to a new GitHub repo, such that every version was still individually browse-able/downloadable and I could view each file's diff from one version to the next.

What would be the best way to accomplish this?

  • Hello Darren, I am not sure if this is the best solution, because I myself am also sort of new to github. But I think each one would have to be its own repository. – khollenbeck Mar 09 '12 at 01:19
  • Also if you weren't planning on making changes to them you could probably pack them all into one repository, and then create a new repository for your newest one. – khollenbeck Mar 09 '12 at 01:20

1 Answers1

2

Presumably you want to end up with a history where each version is a commit, yes? You could unzip the oldest version, git init, git add -A, git commit -m 'Foo v0.1.0'. Then delete all the working tree files (perhaps just as easy as rm -rf *). Now unzip the next version back into the same folder. Re-add everything (git add -A). Commit again. Repeat with each new version.

Lily Ballard
  • 182,031
  • 33
  • 381
  • 347