emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] Novice questions about using git for personal data files


From: Manish
Subject: Re: [Orgmode] Novice questions about using git for personal data files
Date: Fri, 23 Jan 2009 19:43:39 +0530

On Fri, Jan 23, 2009 at 5:25 PM, Alan E. Davis wrote:
> I followed the steps outlined in the worg tutorial about using git to keep
> track of changes to one's own org data tree.
>
> I still don't understand: how does one go about recovering an earlier
> version of a file that has been corrupted? Is there a good tutorial on this
> aspect of using git?

I am not aware of any tutorial on this but may following should help.

1. Do a "git log" in the repo to see what commits you have made
2. Decide from which commit you want to revive the file (most likely
   it would be the top most one.)
3. Note down the SHA1 for this commit (first eight or so characters
   should suffice.)
4. Following should get you the file:
   $ git checkout <SHA1> <file to checkout>
5. You may need to add and commit the file back again to your git
   repo.

Frequent commits is a good idea but it's a burden so you might want to
create a small shell-script to commit periodically (hourly or so
maybe) for you.

Do let us know how it goes.

HTH
-- 
Manish




reply via email to

[Prev in Thread] Current Thread [Next in Thread]