One word -- git.
One more word: Bingo! (git is the answer to preventing this situation in the future.)
And a few more words...
How do I do that?
Spend a few hours one evening reading Pro Git (free). Spend a few hours tinkering, reading man-pages, tinkering some more.
Set up a local repo in one of your project's working directories. Set up a "bare" repo on a NAS you have mounted, or on a physically separate box to which you have SSH access. Learn how to commit, branch, merge, and push your local repo to the mounted or SSH-available one (for safe keeping).
And if you really like learning it backwards and forwards, read Version Control with Git from O'Reilly.
I recommend both Pro Git and Version Control with Git, and I would read them both in that order. The latter doesn't discuss Github at all, but is more thorough in just about every other way. The former is a gentler introduction, I think. Both are valuable.
Then keep in mind the philosophy that anything worth working on is worth committing to version control.
Now for a humorous quote:
"Only wimps use tape backup: real men just upload their important stuff on ftp, and let the rest of the world mirror it ;)"
-- Linus Torvalds, (1996-07-20). Post. linux.dev.kernel newsgroup. Google Groups. Retrieved on 2006-08-28.
I think if Linus had created Git before coining this quote he would have said it more like this: "...real men just upload their important stuff onto an open source git repository, and let the rest of the world fork and clone it. ;)" And if he were a Perl enthusiast he may have mentioned CPAN too. :)
Of course not everything belongs in an open source repo or on CPAN, but Git is great for private projects and local non-distributed version control too. At minimum setting up a bare repo and pushing local commits to it will ensure that you have two copies of the project's entire history; more if your repos themselves are part of an automated backup plan.
Update: How could I forget merlyn's excellent Git talk? Follow the link for the video that includes Randal and his slides. It's just under two hours, and time well spent.
|