Convert folder backups to Git repo -
i have inherited project not developed using scm whatsoever. instead have series of folders like:
my-project.201109011234 my-project.201110010908 my-project.201202040454 my-project.201203011123 ...and on...
each folder complete copy of source code, , folder named after timestamp of when copy made. changes abound between each copy, i.e. files , folders added, removed, renamed , file contents changed.
is there sort of tool, can feed list of folders , create git repo me, each folder becomes commit? after hope git knows changed between each commit?
thanks adam.
it sounds me particular problem solve (i.e. there isn't tried , tested method integrate git).
that said, solution devised bit of shell/python/xyz scripting. steps these:
- make empty git repo
- make list of archives, sorted chronologically
- for each archive:
- delete contents of project directory (everything except .git directory)
- unzip archive project dir
- run "git add -u ." in directory
- run "git add -f ." in directory
- extract/generate commit message based on archive name
- commit current state of project dir
this solution has many limitations (like not performing each commit on archive date) depending on important you, can adapt script.
Comments
Post a Comment